git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Grimm <koreth@midwinter.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH] Teach git-commit about commit message templates.
Date: Tue, 24 Jul 2007 20:01:49 +0800	[thread overview]
Message-ID: <46A5EA2D.1030707@midwinter.com> (raw)
In-Reply-To: <7vfy3fkpr8.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano wrote:
> Offhand, an "interesting" side effect of the above I can see is
> that you will cry "wolf" if the only thing the user did is to
> add his own Signed-off-by: line ;-)  But that is sane in the
> context of coming up with totally new commit log message.
>   

Yes, that is intentional -- the existing git-commit code wasn't treating 
Signed-off-by: as content when it checked for a commit message, so I 
wanted to preserve that behavior.

> I am more worried about how this should interact with cases
> where you usually do not start the log message from scratch.
> For example, are there cases / policies where being able to use
> templates to leave comments on merge commits are needed?
> Squash-commits?  Perhaps "apply this template but only when you
> have hand resolved a conflicting merges"?
>   

Those are all valid cases. They also happen to be ones that are not 
personally useful to me; none of the stuff in my company's commit 
template would really apply to merges. I'm happy to do it if you think 
those cases need to be handled before this can go in, but given there's 
at least one user out there who doesn't need those things, I wonder if 
this makes more sense to hold off on until someone actually asks for it.

> Or even the case of amending a commit made by somebody else,
> without changing the tree contents, in order to make the commit
> log message to conform to the company standard?
>   

It's not clear to me that I can do anything useful in that case, given 
that there's no way to tell in what way the commit message needs to be 
fixed up. If it's a case of, "This engineer committed without using the 
template at all," then I can see an argument for loading the template 
above / below the existing comment, but IMO a more common case will be 
something like, "The format is right, but the bug ID isn't filled in or 
is incorrect," in which case any template I supply would be useless and 
annoying.

Is your hunch about the common case different than mine? Again, I can go 
address this if it'll actually be useful. Maybe by always including the 
template if the command-line option is used, but skipping it in these 
cases if the config option is used? Or something like that? (On the 
other hand, if you have to specify the template on the command line, 
maybe it's easier to just load it into the editor as needed.)

-Steve

  reply	other threads:[~2007-07-24 12:01 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
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 [this message]
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=46A5EA2D.1030707@midwinter.com \
    --to=koreth@midwinter.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).