Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
87ce5068
Commit
87ce5068
authored
Nov 26, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pre-commit script
parent
7c794b8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
pre-commit
pre-commit
+27
-0
No files found.
pre-commit
0 → 100755
View file @
87ce5068
#!/bin/sh -e
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
CLANGFORMATDIFF
=
`
git config
--get
clangformatdiff.binary
`
if
[
-z
"
$CLANGFORMATDIFF
"
]
;
then
CLANGFORMATDIFF
=
clang-format-diff.py
fi
errors
=
`
git diff-index
--cached
--diff-filter
=
ACMR
-p
HEAD
--
|
$CLANGFORMATDIFF
-p1
`
if
[
-n
"
$errors
"
]
;
then
echo
"
$errors
"
echo
"--"
echo
"[ERROR] We have detected the difference between the code to commit"
echo
"and clang-format style rules. Please fix this problem in either:"
echo
"1) Apply patch above."
echo
"2) Use clang-format to format lines."
echo
"3) Reformat these lines manually."
echo
"Aborting commit."
exit
1
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment