I'm not committing this as it contradicts a comment in the script, but I think something like this is needed to allow one to abort a commit normally.
I've gone hunting for my vim process to kill a couple of times now. cheers, Pádraig. commit bdd5930b87071bcda32f92d3c8798d0e1a91f966 Author: Pádraig Brady <[email protected]> Date: Thu Jan 26 00:55:55 2012 +0000 scripts: allow empty commit messages abort the commit * scripts/git-hooks/commit-msg: Validate empty commit messages, so that git will abort the commit as normal. diff --git a/scripts/git-hooks/commit-msg b/scripts/git-hooks/commit-msg index e1bb382..4a0a6b9 100755 --- a/scripts/git-hooks/commit-msg +++ b/scripts/git-hooks/commit-msg @@ -95,13 +95,13 @@ sub check_msg($$) # with lines that start with "#" in the log. # Filter out leading blank and comment lines. - # while (@line && $line[0] =~ /^(?:#.*|[ \t]*)$/) { shift @line; } + while (@line && $line[0] =~ /^(?:#.*|[ \t]*)$/) { shift @line; } # Filter out blank and comment lines at EOF. - # while (@line && $line[$#line] =~ /^(?:#.*|[ \t]*)$/) { pop @line; } + while (@line && $line[$#line] =~ /^(?:#.*|[ \t]*)$/) { pop @line; } @line == 0 - and return 'no log message'; + and return ''; # let git abort my $bad = bad_first_line $line[0]; $bad
