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

Re: git log format documentation/manpage

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 25, 2025, 16:35 UTC
Message-ID
<xmqq4irnndm3.fsf@gitster.g>
In-Reply-To
<CALnO6CBLUGgBMeRf0uLA=TKVaMQvap9Wpa4uTAGQD5he40xeWw@mail.gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 5 quoted lines
> I don't have the answer to everything, but for your goal, does
> `--oneline --notes` not give you something close enough?
>
> Since notes can be arbitrary text, making them "inline" with the
> oneline format seems like an uphill battle to me.

A commit log message is an arbitrary piece of text, so we gave the distinction of %s (subject) vs %b (body) to allow us to say "%h %s" to show only the commit subject.

There is nothing similar for notes, so in that sense, you are correct to point out that only with %N, it would not be possible to come up with universally good formatting, unless you somehow control what you write in your notes (e.g. limit yourself to oneliners).

If the rumored unification of format languages between "git log" family of commands and "git for-each-ref" family of commands ever comes, then we might be able to borrow conditional formatting and text manipulation primitives the latter may have in order to do things like "show the first line of note string, inside a pair of parentheses, but only do so when note does exist and not empty".

But until the unification of format languages happens (which as far as I understand nobody is working on right now, even though I vaguely recall it was a topic in vogue for mentoring programs some years ago), I do not think it is feasible.

Previous: D. Ben KnobleNext: René Scharfe
Message 3 of 4 in “git log format documentation/manpage”
  1. David MobergOct 24, 2025
  2. D. Ben KnobleOct 25, 2025
  3. Junio C HamanoOct 25, 2025
  4. René ScharfeOct 25, 2025

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.