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

Re: [PATCH 0/2] some parse_revision_opt() bugfixes

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2026, 22:23 UTC
Message-ID
<xmqqbj9lt1gn.fsf@gitster.g>
In-Reply-To
<20260925203359.GA1506705@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 24 quoted lines
> On Fri, Sep 25, 2026 at 04:26:36AM -0400, Jeff King wrote:
>
>> > I have bisected this to cd439487 (revision: manage memory ownership of
>> > argv in setup_revisions(), 2025-09-19).
>> 
>> Yep, definitely my fault. I don't have time to do a full write-up now,
>> but the most direct solution is:
>> [...]
>> But I think instead doing this:
>
> I ended up reversing my decision there, for reasons that are explained
> in the second commit. But the good news is that doing so also revealed a
> related bug that predates even cd439487.
>
> So here are the fixes. I apologize in advance for the length of the
> second commit message. At least I feel good about my decision to go to
> bed before writing it. ;)
>
>   [1/2]: revision: avoid reporting known options as unknown on error
>   [2/2]: revision: handle argv movement in parse_revision_opt()
>
>  revision.c          |  7 +++++--
>  t/t4201-shortlog.sh | 11 +++++++++++
>  2 files changed, 16 insertions(+), 2 deletions(-)
Both patches make sense.

: git; rungit v2.52.0 shortlog -n --no-such-option 2>&1 | head -n1 error: unknown option `(null)' : git; rungit v2.51.0 shortlog -n --no-such-option 2>&1 | head -n1 error: unknown option `--no-such-option' : git; ./git shortlog -n --no-such-option 2>&1 | head -n1 error: unknown option `--no-such-option'

Previous: Kristoffer Haugsbakk
Message 9 of 9 in “[BUG] revision: premature free-and-null causes “unknown option `(null)`””
  1. Kristoffer HaugsbakkSep 25, 2026
  2. Jeff KingSep 25, 2026
  3. 0/2 some parse_revision_opt() bugfixesJeff King, Sep 25, 2026
  4. 1/2 revision: avoid reporting known options as unknown on errorJeff King, Sep 25, 2026
  5. 2/2 revision: handle argv movement in parse_revision_opt()Jeff King, Sep 25, 2026
  6. Kristoffer HaugsbakkSep 26, 2026
  7. Jeff KingSep 28, 2026
  8. Kristoffer HaugsbakkSep 29, 2026
  9. Junio C HamanoSep 25, 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.