Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aron Helser
VTK
Commits
6c7e3f42
Commit
6c7e3f42
authored
Jun 16, 2010
by
Brad King
Browse files
commit-msg: Reject leading or trailing space on first line
parent
1387c7ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
commit-msg
View file @
6c7e3f42
...
...
@@ -38,6 +38,10 @@ msg_first() {
------------------------------------------------------------------------------
'
"
$line
"
'
------------------------------------------------------------------------------
'
elif
echo
"
$line
"
|
grep
"^[ ]
\|
[ ]$"
>
/dev/null 2>&1
;
then
die
'The first line may not have leading or trailing space:
['
"
$line
"
']
'
else
# first line okay
...
...
@@ -61,7 +65,7 @@ msg_rest() {
# Pipe commit message into the state machine.
state
=
first
cat
"
$commit_msg
"
|
while
read
line
;
do
while
IFS
=
''
read
line
;
do
msg_
$state
||
break
done
&&
rm
-f
"
$commit_msg
"
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