Re: Add option in git-am to ignore leading text?

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

 



The 28/07/09, Frans Pop wrote:
> 
> That's a very useful feature. However, on lkml there are frequently also 
> mails with the following structure (example: [1]).
> 
> [1] http://lkml.org/lkml/2009/7/10/49

This is an example of what not to do. Content after the '---' won't be
part of the commit message.

  $ man git-am
  <snip>
	The commit message is formed by the title taken from the "Subject: ",
  a blank line and the body of the message up to where the patch begins.
  Excess whitespace at the end of each line is automatically stripped.

  The patch is expected to be inline, directly following the
  message. Any line that is of the form:
   ·   three-dashes and end-of-line, or
   ·   a line that begins with "diff -", or
   ·   a line that begins with "Index: "
  is taken as the beginning of a patch, and the commit log message
  is terminated before the first occurrence of such a line.
  <snip>

> <example>
> [Regular mail headers, including From: and Subject:]
> 
> [Comments, quotes from previous messages, or some introduction]
> 
> From: [email address]
> Subject: [patch short description]
> [patch long description]
> 
> [patch diff]
> </example>
> 
> Here the overruling pseudo-headers are not at the beginning of the 
> message, which results in all the leading comments getting included in 
> the commit log and those have to be cleaned manually.
> 
> Would it be possible to add an option to git-am to "reset" the commit log 
> when it encounters either a From: or Subject: pseudo header, so that only 
> the intended patch short and long descriptions are used for the commit 
> log?

IMHO, a better way would be to ignore lines beginning with a defined
level of quotes in the commit message (the "level" beeing the number of
'>' or '> ' found at the beginning of a line. Something like

	--strip-quotes[=N]

where N is the level of quoted lines to remove (if "=N" is
not given, assume that the level is 1 and remove all the quotes).

Comments?

-- 
Nicolas Sebrecht
--
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]