emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 89b2bf6 1/3: Have commit-msg report commit failure


From: Paul Eggert
Subject: [Emacs-diffs] master 89b2bf6 1/3: Have commit-msg report commit failure
Date: Sat, 11 Apr 2015 02:12:36 +0000

branch: master
commit 89b2bf617fa0619d57e8875d6d15aa765d765482
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Have commit-msg report commit failure
    
    * build-aux/git-hooks/commit-msg: If the commit is aborted,
    say so.  Simplify by doing this at the end.  Problem reported
    by Eli Zaretskii in:
    http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00566.html
---
 build-aux/git-hooks/commit-msg |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index 13a0535..6721d53 100755
--- a/build-aux/git-hooks/commit-msg
+++ b/build-aux/git-hooks/commit-msg
@@ -63,7 +63,7 @@ exec $awk '
   /^#/ { next }
 
   !/^.*$/ {
-    print "Invalid character (not UTF-8) in commit message; see 'CONTRIBUTE'"
+    print "Invalid character (not UTF-8) in commit message"
     status = 1
   }
 
@@ -77,13 +77,13 @@ exec $awk '
       sub(/^squash! /, "")
 
     if ($0 ~ "^" space) {
-      print "White space at start of commit message'\''s first line; see 
'CONTRIBUTE'"
+      print "White space at start of commit message'\''s first line"
       status = 1
     }
   }
 
   nlines == 2 && $0 ~ non_space {
-    print "Nonempty second line in commit message; see 'CONTRIBUTE'"
+    print "Nonempty second line in commit message"
     status = 1
   }
 
@@ -97,30 +97,33 @@ exec $awk '
   }
 
   78 < length && $0 ~ space {
-    print "Line longer than 78 characters in commit message; see 'CONTRIBUTE'"
+    print "Line longer than 78 characters in commit message"
     status = 1
   }
 
   140 < length {
-    print "Word longer than 140 characters in commit message; see 'CONTRIBUTE'"
+    print "Word longer than 140 characters in commit message"
     status = 1
   }
 
   /^Signed-off-by: / {
-    print "'\''Signed-off-by:'\'' in commit message; see 'CONTRIBUTE'"
+    print "'\''Signed-off-by:'\'' in commit message"
     status = 1
   }
 
   $0 ~ non_print {
-    print "Unprintable character in commit message; see 'CONTRIBUTE'"
+    print "Unprintable character in commit message"
     status = 1
   }
 
   END {
     if (nlines == 0) {
-      print "Empty commit message; see 'CONTRIBUTE'"
+      print "Empty commit message"
       status = 1
     }
+    if (status != 0) {
+      print "Commit aborted; please see the file 'CONTRIBUTE'"
+    }
     exit status
   }
 ' <"$1"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]