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

Re: log --format existence of notes?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2024, 00:06 UTC
Message-ID
<xmqqsersyrch.fsf@gitster.g>
In-Reply-To
<D5N39IJA0WDQ.2WH1MNIP77X2J@ferdinandy.com>
"Bence Ferdinandy" <bence@ferdinandy.com> writes:
Show 6 quoted lines
> based on the man pages it doesn't seem possible, but maybe I'm missing something.
>
> I would like to put together a "log --format=" which is similar to --oneline,
> but where if there's a note for the commit it's marked with e.g. a notebook
> symbol. There's %N, but that prints the entire note, so it doesn't work well
> with one commit per line.

I do not think it is doable. Unlike the format language in the for-each-ref/branch --list family of commands, the pretty-format language in the log family of commands lack more involved conditional formatting features.

Unifying these two formatting languages to port features from one to the other would be needed, I guess. If we had a note support in the latter, something like

$ git branch -l --format='%(subject)%(if)%(note:amlog)%(then)📓%(end)'
may have worked.
Previous: Bence FerdinandyNext: Bence Ferdinandy
Message 2 of 7 in “log --format existence of notes?”
  1. Bence FerdinandyNov 15, 2024
  2. Junio C HamanoNov 16, 2024
  3. Bence FerdinandyNov 16, 2024
  4. ref-filter: add "notes" atomKousik Sanagavarapu, Nov 20, 2024
  5. Junio C HamanoNov 20, 2024
  6. Kousik SanagavarapuDec 1, 2024
  7. Simon RichterNov 21, 2024

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.