{"thread":{"id":"5234","subject":"[PATCH] hooks--commit-msg: no silent exit on duplicate Signed-off-by lines","startedAt":"2006-08-14T02:43:58Z","lastAt":"2006-08-14T02:43:58Z","messageCount":1,"participants":["Luben Tuikov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25211","messageId":"20060814024358.20988.qmail@web31803.mail.mud.yahoo.com","threadId":"5234","inReplyTo":null,"subject":"[PATCH] hooks--commit-msg: no silent exit on duplicate Signed-off-by lines","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2006-08-14T02:43:58Z","receivedAt":"2006-08-14T02:43:58Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"The commit-msg hook would silently exit if duplicate\nSigned-off-by lines were found.  Users of git-commit would\nnot know it, unless they checked '$?'.  This patch makes the\ncommit-msg hook actually print out a message that duplicate\nSigned-off-lines were found (and thus nothing were\ncommitted).\n\nSigned-off-by: Luben Tuikov <ltuikov@yahoo.com>\n---\n templates/hooks--commit-msg |    7 +++++--\n 1 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/templates/hooks--commit-msg b/templates/hooks--commit-msg\nindex 23617f3..ec2b017 100644\n--- a/templates/hooks--commit-msg\n+++ b/templates/hooks--commit-msg\n@@ -10,5 +10,8 @@ # To enable this hook, make this file ex\n \n # This example catches duplicate Signed-off-by lines.\n \n-test \"\" = \"$(grep '^Signed-off-by: ' \"$1\" |\n-\t sort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\"\n+if [ -n \"$(grep '^Signed-off-by: ' \"$1\" |\n+\tsort | uniq -c | sed -e '/^[ \t]*1[ \t]/d')\" ] ; then\n+    echo \"Duplicate Signed-off-by lines in commit message\"\n+    exit 1\n+fi\n-- \n1.4.2.g73dbd\n"}]}