From: Junio C Hamano Date: Fri, 13 Nov 2026 22:10:29 GMT Subject: Re: [PATCH] for-each-ref: avoid segfault on --no-format Message-ID: In-Reply-To: <20261113161413.15688-1-agab0323@gmail.com> aeron-gh writes: > The "--format" option is declared with OPT_STRING(), so the > parse-options machinery also accepts "--no-format" and sets the > format string to NULL. The default format is assigned before the > command line is parsed, so nothing puts it back, and the NULL is > dereferenced in verify_ref_format(): > > $ git for-each-ref --no-format > Segmentation fault That is bad. PARSE_OPT_NONEG is necessary, I guess? Another plausible interpretation may be to exit without showing anything, but that does not sound like a very useful behaviour. > 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? > Signed-off-by: aeron-gh Please check [[dco]] and [[real-name]] A few sections in Documentation/SubmittingPatches. Thanks.