git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Grimm <koreth@midwinter.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Teach git-commit about commit message templates.
Date: Mon, 23 Jul 2007 18:23:48 +0800	[thread overview]
Message-ID: <46A481B4.7000502@midwinter.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0707231059490.14781@racer.site>

Johannes Schindelin wrote:
> 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"
>   

The template can itself have comments -- instructions or explanations of 
fields to fill in, for example -- and since comments have been stripped 
from COMMIT_MSG at this point, a comparison against such a template 
would always fail. And, consistent with the current behavior, simply 
adding a Signed-off-by: line shouldn't count as supplying a commit message.

I could do this test before stripping comments from COMMIT_MSG, but then 
I'd still fail the comparison if the user just deleted some comment 
lines manually, which also seems wrong to me -- the comments should be 
totally ignored when doing this comparison, IMO. Plus that wouldn't 
ignore Signed-off-by: lines.

If I'm coming at the design the wrong way, I'm of course happy to adjust 
it, but insensitivity to both comments and Signed-off-by: lines seemed 
like the right behavior from the user's POV to me, and I didn't see a 
cleaner way to do it.

Thanks for looking at the patch!

-Steve

  reply	other threads:[~2007-07-23 10:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23  4:17 [PATCH] Teach git-commit about commit message templates Steven Grimm
2007-07-23 10:04 ` Johannes Schindelin
2007-07-23 10:23   ` Steven Grimm [this message]
2007-07-23 10:40     ` Johannes Schindelin
2007-07-23 10:56       ` Steven Grimm
2007-07-23 11:58         ` Johannes Schindelin
2007-07-23 17:12         ` Junio C Hamano
2007-07-24 12:01           ` Steven Grimm
2007-07-24 21:43             ` Junio C Hamano
2007-07-25  6:42               ` Steven Grimm
2007-07-25  7:39                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46A481B4.7000502@midwinter.com \
    --to=koreth@midwinter.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).