From: Gary V. Vaughan Date: Sat, 22 May 2010 11:10:27 +0000 (+0700) Subject: Support "git log --oneline" in generated commit messages. X-Git-Tag: v2.2.8~2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=efa4f5e852320fca3b5eada20d75d92720c0b660;p=thirdparty%2Flibtool.git Support "git log --oneline" in generated commit messages. * clcommit.m4sh (func_check_commit_msg): Insert an empty line between the ChangeLog entry summary line and the ChangeLog entry body, so that "git log --oneline" works properly. Bump copyright and version number. Reported by Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 89d69da41..0eb77fffb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-05-22 Gary V. Vaughan + + Support "git log --oneline" in generated commit messages. + * clcommit.m4sh (func_check_commit_msg): Insert an empty line + between the ChangeLog entry summary line and the ChangeLog entry + body, so that "git log --oneline" works properly. + Bump copyright and version number. + Reported by Ralf Wildenhues + 2010-05-22 Ralf Wildenhues * HACKING: Set Reply-To: in announcement emails. diff --git a/clcommit.m4sh b/clcommit.m4sh index 351076a3e..8c14be2aa 100644 --- a/clcommit.m4sh +++ b/clcommit.m4sh @@ -1,11 +1,11 @@ AS_INIT[]m4_divert_push([HEADER-COPYRIGHT])dnl # @configure_input@ -# clcommit (GNU @PACKAGE@) version 2.0 +# clcommit (GNU @PACKAGE@) version 2.0.1 # Written by Gary V. Vaughan # and Alexandre Oliva -# Copyright (C) 1999, 2000, 2004, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -319,6 +319,7 @@ func_check_commit_msg () fi func_verbose "$progname: checking commit message..." + separate_summary=: # whether to separate summary lines for git if $opt_first; then skipping=: $SED 's,^,+,' < ${ChangeLog-ChangeLog} | @@ -328,8 +329,18 @@ func_check_commit_msg () "+ "*) func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:" echo "$line" | $SED 's/^.//' >&2;; - "+ "*) - $skipping || echo "$line" ;; + "+ *"*) # asterisk marks end of summary line + $skipping || echo "$line" + separate_summary=false ;; + "+ "*".") # summary line must end with a period + $skipping || { + echo "$line" + $separate_summary && echo "+ " + separate_summary=false + };; + "+ "*) # no separator for multiline summary + echo "$line" + separate_summary=false ;; esac done | $SED 's,^\+ ,,' > "$log_file" || exit $EXIT_FAILURE @@ -345,7 +356,16 @@ func_check_commit_msg () func_error "*** Warning: lines should start with tabs, not spaces; ignoring line:" echo "$line" | $SED 's/^.//' >&2;; "+") echo ;; - "+ "*) echo "$line";; + "+ *"*) # asterisk marks end of summary line + echo "$line" + separate_summary=false ;; + "+ "*".") # summary line must end with a period + echo "$line" + $separate_summary && echo "+ " + separate_summary=false ;; + "+ "*) # no separator for multiline summary + echo "$line" + separate_summary=false ;; esac done | $SED -e 's,\+ ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \