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

Re: rev-list pretty format behavior

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 5, 2015, 21:12 UTC
Message-ID
<xmqqlhi6cma5.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHaCNWJZQRVxp3ponvh3pPEk=sOHGYypyhi1Dc8HX5gkKEBGrQ@mail.gmail.com>
Oliver Runge <oliver.runge@gmail.com> writes:
Show 10 quoted lines
> I'm using git version 2.4.0-rc1. The same behavior exists in 2.1.0.
>
> Trying the same with rev-list results in:
>> git rev-list --pretty=format:"%h ..." HEAD~3...HEAD
> commit 826aed50cbb072d8f159e4c8ba0f9bd3df21a234
> 826aed5 ...
> commit 915e44c6357f3bd9d5fa498a201872c4367302d3
> 915e44c ...
> commit 067178ed8a7822e6bc88ad606b707fc33658e6fc
> 067178e ...

This is very much the designed behaviour, I would think. IIRC, the user-format support of "rev-list" was designed so that the scripts can customize the output from "rev-list -v", which was how scripts were expected to read various pieces of information for each commit originally. And the 40-hex commit object name and/or a line that begins with "commit ..." when a user format is used are meant to serve as stable record separator (in that sense, having %H or %h in the userformat given to rev-list is redundant) when these scripts are reading output from "rev-list".

A new option to tell "rev-list" that "I am designing an output that is a-line-per-commit with the userformat and do not need the default record separator" or "I will arrange record separator myself" would be an acceptable thing to add, provided if many scripts yet to be written would benefit from such a feature, though.

Previous: Oliver RungeNext: Oliver Runge
Message 2 of 5 in “rev-list pretty format behavior”
  1. Oliver RungeApr 4, 2015
  2. Junio C HamanoApr 5, 2015
  3. Oliver RungeApr 6, 2015
  4. Michael J GruberApr 7, 2015
  5. Oliver RungeApr 8, 2015

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.