From 6897067b692fc9a5001087a3abaae6b478b068f7 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Wed, 9 Jun 2010 17:03:22 +0700 Subject: [PATCH] Don't warn about the blank line inserted into git commit message. * clcommit.m4sh: When searching for accidental commits of mutliple changes, ignore the second line of the message, which we inserted earlier to support "git log --oneline". --- ChangeLog | 5 +++++ clcommit.m4sh | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a7776be20..275575be8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-06-09 Gary V. Vaughan + Don't warn about the blank line inserted into git commit message. + * clcommit.m4sh: When searching for accidental commits of mutliple + changes, ignore the second line of the message, which we inserted + earlier to support "git log --oneline". + Enable correct extraction of multiline copyright from --version. * libltdl/config/getopt.m4sh: Wrap copyright notice at 76 columns. diff --git a/clcommit.m4sh b/clcommit.m4sh index c79e6b94d..93d5f9924 100644 --- a/clcommit.m4sh +++ b/clcommit.m4sh @@ -337,7 +337,9 @@ func_mailnotify () grep '[^ ]' < "$log_file" > /dev/null || func_fatal_error "empty commit message, aborting" - if grep '^$' < "$log_file" > /dev/null; then + # We expect line 2 to be blank, since it separates the git summary line from + # the commit message body, but any others are probably an error: + if sed 2d "$log_file" | grep '^$' > /dev/null; then func_error "*** Warning: blank lines should not appear within commit messages." func_error "*** They should be used to separate distinct commits." fi -- 2.47.2