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

Re: [PATCH] for-each-ref: avoid segfault on --no-format

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 13, 2026, 23:11 UTC
Message-ID
<xmqqse148gyf.fsf@gitster.g>
In-Reply-To
<xmqqjymg9ycq.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
>> Marking the option with PARSE_OPT_NONEG would also stop the crash,
>> but then "--no-format" would work for "git branch" and "git tag"
>> and be an error here.
>
> Shouldn't "git branch --no-format" also error out?

Hmph, "git branch --no-format" seems to take it as an instruction to revert to the default format. Making "--no-format" mean the same thing in "for-each-ref" may make sense.

The implementation of "git branch" side is quite clean; if format.format has a value, use it, or fill it with default. Perhaps mimicking it would give us the right behaviour? I didn't check.

Previous: Junio C HamanoNext: Abhishek Agarwal
Message 3 of 6 in “for-each-ref: avoid segfault on --no-format”
  1. for-each-ref: avoid segfault on --no-formataeron-gh, Nov 13, 2026
  2. Junio C HamanoNov 13, 2026
  3. Junio C HamanoNov 13, 2026
  4. Abhishek AgarwalNov 14, 2026
  5. for-each-ref: avoid segfault on --no-formatAbhishek Agarwal, Nov 14, 2026
  6. Patrick SteinhardtNov 16, 2026

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.