emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 68a74dd 3/3: Fix commit-msg to handle scissors line


From: Paul Eggert
Subject: [Emacs-diffs] master 68a74dd 3/3: Fix commit-msg to handle scissors lines
Date: Sat, 11 Apr 2015 02:12:36 +0000

branch: master
commit 68a74dd12ad8c28bfe6fb2c0232a7beea548c4c6
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Fix commit-msg to handle scissors lines
    
    * build-aux/git-hooks/commit-msg:
    Ignore every line after a scissors line, such as a line generated
    by 'git commit -v'.  Problem reported by Johan Bockgård in:
    http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00580.html
---
 build-aux/git-hooks/commit-msg |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-msg
index 5b07b6c..ea8d909 100755
--- a/build-aux/git-hooks/commit-msg
+++ b/build-aux/git-hooks/commit-msg
@@ -62,7 +62,13 @@ exec $awk -v at_sign="$at_sign" -v cent_sign="$cent_sign" '
     }
   }
 
-  /^#/ { next }
+  /^#/ {
+    # Ignore every line after a scissors line.
+    if (/^# *---* *(>[8%]|[8%]<) *---* *$/) { exit }
+
+    # Ignore comment lines.
+    next
+  }
 
   !/^.*$/ {
     print "Invalid character (not UTF-8) in commit message"



reply via email to

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