Subject: Re: [RFC PATCH] builtin-log: Add options to --coverletter

From: Jeff King <[email-masked]>
Date: Sat, 16 May 2009 01:07:19 -0400

On Fri, May 15, 2009 at 11:11:13AM -0700, Junio C Hamano wrote:

> This is a tangent, but I do not think the current cover-letter that uses
> shortlog matches everybody's needs.  The shortlog format lists commits
> grouped by the author and does not number them, and it makes it hard to
> match which message in the series corresponds to which entry in the cover
> letter, especially when your series have a resend of somebody else's patch
> in it.  I wouldn't be surprised if somebody comes up with a different
> style that is based on "git log --reverse --oneline A..B" output (perhaps
> without the shortened object name part) and name it the "oneline" style,
> e.g.
> 
>     From: Jeff King
> 
>     *** BLURB HERE ***
>     The following patches do ...
> 
>     1/2	parseopt: add OPT_NEGBIT (Réne Scharfe)
>     2/2 ls-files: make --no-empty-directory negatable

At one point I was working on --pretty=format specifiers for "total
number of commits" and "incremental commit number". The eventual goal
being an option like coverletter.logformat that you could set to
"%xi/%xn %s".

Sadly, the code got a bit messy because the feature straddles the line
of pretty.c and actual rev traversal. I started some refactoring, but
dropped it halfway through, and now of course it is woefully out of date
(a lesson in "merge early, merge often"). So I just pipe "git log
--oneline" through nl manually. ;)

So yes, I think somebody would be interested in alternate styles. And
while I think most people would want to set their default style as a
config variable, it may make sense to override on the command-line
(e.g., for a series that is mostly from you versus one that is from
mixed authors).

-Peff