git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] pretty.c: add %O format specifier to format_commit_one()

From
Jeff King <peff@peff.net>
Date
May 2, 2010, 04:55 UTC
Message-ID
<20100502045552.GC14776@coredump.intra.peff.net>
In-Reply-To
<7vsk6b5yms.fsf@alter.siamese.dyndns.org>
On Sat, May 01, 2010 at 10:18:35AM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> Alexander Shishkin <ash@koowaldah.org> writes:
> 
> > This specifier represents the number of each commit in the output
> > stream.
> 
> I don't like this.  What does such a number _mean_ in a non-linear
> history?
> 
> Also the next person who sees this will inevitably ask for %TOTAL to so
> that the output can say [N/M], but that would mean the list has to be
> limited and we cannot stream the output anymore.

Hmph. I started on a patch a while ago (but never finished) that would allow an [N/M] output. My intent was to allow pretty-format specifiers for generating cover letters[1].

Of course you can't stream when asking for %TOTAL, but that is already the case with format-patch, which does such a calculation when numbering patch subjects. We could use userformat_find_requirements to do the lookup when needed, and then only formats which use the placeholder would have to pay the penalty.

-Peff
[1] These days I do:
  git format-patch --stdout "$@" |
    sed -ne 's/^Subject: //p' |
    sed -e 's/\[PATCH /[/' \
        -e 's/]/]:/' \
        -e 's/^/  /'
and pull the result into a cover letter that I write manually.
Previous: Jakub Narebski
Message 5 of 5 in “pretty.c: add %O format specifier to format_commit_one()”
  1. pretty.c: add %O format specifier to format_commit_one()Alexander Shishkin, May 1, 2010
  2. Junio C HamanoMay 1, 2010
  3. Alexander ShishkinMay 1, 2010
  4. Jakub NarebskiMay 1, 2010
  5. Jeff KingMay 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.