From: Junio C Hamano Date: Fri, 13 Nov 2026 23:11:36 GMT Subject: Re: [PATCH] for-each-ref: avoid segfault on --no-format Message-ID: In-Reply-To: Junio C Hamano writes: >> 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.