summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <hun@n-dimensional.de>2007-12-02 00:25:22 +0100
committerHans Ulrich Niedermann <hun@n-dimensional.de>2008-07-19 00:40:27 +0200
commit064d9f5903beabca44d3866f93d21e79100548fc (patch)
tree21978d4296954e0da1ef0ccbfc2734999d100cee
parent7134ae0e97f9737a51c222de49be9a8d6d34401a (diff)
downloadndim-git-utils-064d9f5903beabca44d3866f93d21e79100548fc.tar.gz
ndim-git-utils-064d9f5903beabca44d3866f93d21e79100548fc.tar.xz
ndim-git-utils-064d9f5903beabca44d3866f93d21e79100548fc.zip
More messages, add note on disappearing commit msg
-rwxr-xr-xgit-check-commit-msg/git-check-commit-msg8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-check-commit-msg/git-check-commit-msg b/git-check-commit-msg/git-check-commit-msg
index 060fced..ae6d3ff 100755
--- a/git-check-commit-msg/git-check-commit-msg
+++ b/git-check-commit-msg/git-check-commit-msg
@@ -1,9 +1,15 @@
#!/bin/sh
+# FIXME: Save the commit message somewhere?
+# $ git commit -F .git/COMMIT_EDITMSG
+# Results in an empty commit message in this run.
msgfile="$1"
+common="You might want to fix this and retry the commit."
+
test -s "$msgfile" || {
echo >&2 "Commit message must NOT be empty."
+ echo >&2 "$common"
exit 1
}
@@ -12,10 +18,12 @@ test "x$(sed -n '1s/^.\{,50\}//p' "$msgfile")" = "x" || {
echo >&2 "First line is too long. It should be <= 50 characters."
echo >&2 "These characters fit: $(sed -n '1s/^\(.\{,50\}\)\(.*\)$/\1/p' "$1")"
echo >&2 "These exceed the limit: $(sed -n '1s/^\(.\{,50\}\)\(.*\)$/\2/p' "$1")"
+ echo >&2 "$common"
exit 1
}
test "x$(sed -n 's/^#.*//; 2p' "$msgfile")" = "x" || {
echo >&2 "Second line should be empty."
+ echo >&2 "$common"
exit 1
}