From: Johannes Schindelin Date: Mon, 23 Jul 2007 10:04:04 GMT Subject: Re: [PATCH] Teach git-commit about commit message templates. Message-ID: In-Reply-To: <20070723041741.GA22461@midwinter.com> Hi, On Sun, 22 Jul 2007, Steven Grimm wrote: > @@ -572,10 +591,35 @@ else > fi | > git stripspace >"$GIT_DIR"/COMMIT_MSG > > -if cnt=`grep -v -i '^Signed-off-by' "$GIT_DIR"/COMMIT_MSG | > - git stripspace | > - wc -l` && > - test 0 -lt $cnt > +# Test whether the commit message has any content we didn't supply. > +have_commitmsg= > +grep -v -i '^Signed-off-by' "$GIT_DIR"/COMMIT_MSG | > + git stripspace > "$GIT_DIR"/COMMIT_BAREMSG Up until here, I was with you. But this feels very wrong. Why not compare COMMIT_MSG to the templatefile, if there is one? I.e. test ! -z "$templatefile" && cmp "$GIT_DIR"/COMMIT_MSG "$templatefile" && die "Unchanged message; will not commit" Hmm? Ciao, Dscho