Re: [PATCH] Teach git-commit about commit message templates.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steven Grimm <koreth@xxxxxxxxxxxxx> writes:

> With the patch, my intent was:
>
> * Strip off all comment lines
> * Strip off all Signed-off-by: lines
> * Trim whitespace
> * If the result has no content (! -s file), abort.
> * If a template file was specified:
>   * Strip off all comment and Signed-off-by: lines from the template
>   * Trim whitespace from the template
>   * If the resulting trimmed template is the same as the trimmed
> commit message, abort.
>
> So I guess before getting to the specifics of the code, I'll ask: does
> the above make sense as a design? I wanted to preserve the existing
> behavior in the absence of a template.

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.

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"?

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?

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux