aboutsummaryrefslogtreecommitdiffstats
path: root/git-tools
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-04-17 05:59:35 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-04-17 06:05:33 -0400
commitaceca2566b80753d79c1dc77f5470618b0a2078d (patch)
tree50c644085718122c5524c8cf857649f1a2777073 /git-tools
parent45b910f9b445dc50cf65e456d8fe6f3aae2cbc11 (diff)
downloadforums-aceca2566b80753d79c1dc77f5470618b0a2078d.tar
forums-aceca2566b80753d79c1dc77f5470618b0a2078d.tar.gz
forums-aceca2566b80753d79c1dc77f5470618b0a2078d.tar.bz2
forums-aceca2566b80753d79c1dc77f5470618b0a2078d.tar.xz
forums-aceca2566b80753d79c1dc77f5470618b0a2078d.zip
[ticket/10767] Clarify what happens at the end of the hook.
If there are problems and fatal is true, print that the commit is aborted. If there are problems and fatal is false, print instructions for fixing the commit. PHPBB3-10767
Diffstat (limited to 'git-tools')
-rwxr-xr-xgit-tools/hooks/commit-msg9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg
index fbeda805b7..b156d276df 100755
--- a/git-tools/hooks/commit-msg
+++ b/git-tools/hooks/commit-msg
@@ -63,10 +63,17 @@ debug()
quit()
{
- if [ $1 -gt 0 ] && [ $1 -ne $ERR_UNKNOWN ] && [ $fatal -eq 0 ]
+ if [ $1 -eq 0 ] || [ $1 -eq $ERR_UNKNOWN ]
then
+ # success
+ exit 0;
+ elif [ $fatal -eq 0 ]
+ then
+ # problems found but fatal is false
+ complain 'Please run `git commit --amend` and fix the problems mentioned.' 1>&2
exit 0;
else
+ complain "Aborting commit." 1>&2
exit $1;
fi
}