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

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

From
AAAbhishek Agarwal <agab0323@gmail.com>
Date
Nov 14, 2026, 04:53 UTC
Message-ID
<20261114045358.26780-1-agab0323@gmail.com>
In-Reply-To
<xmqqse148gyf.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> 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.
Yes, the patch does the same thing.  After parse_options() it has
	if (!format.format)
		format.format = "%(objectname) %(objecttype)\t%(refname)";

so "--no-format" gives the default output, like it does for "git branch" and "git tag". The new test checks that "--format=<fmt> --no-format" prints the same as giving no option at all.

I will send a v2 with the name in the sign-off fixed. I do not plan any code change, unless u see something else.

Thanks.
Previous: Junio C HamanoNext: Abhishek Agarwal
Message 4 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.