1
0
mirror of https://github.com/git/git.git synced 2024-09-28 04:10:41 +02:00

sample commit-msg hook: no silent exit on duplicate Signed-off-by lines

git-commit would silently exit if duplicate Signed-off-by
lines were found.  Users of git-commit would not know it,
unless they checked '$?'.  This patch makes git-commit
actually print out a message that nothing was commited
since duplicate Signed-off-lines were found.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Luben Tuikov 2006-08-13 01:41:22 -07:00 committed by Junio C Hamano
parent e77235ea38
commit 9a1ae9ab03

View File

@ -11,4 +11,8 @@
# This example catches duplicate Signed-off-by lines.
test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')"
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}