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

Re: [PATCH] show-branch: fix SEGFAULT on both --current & --reflog

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 22, 2022, 18:43 UTC
Message-ID
<xmqq4k2l9cwo.fsf@gitster.g>
In-Reply-To
<xmqqv8v19ght.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
>> It seems that it has been introduced in: Commit 1aa68d6735
>> (show-branch: --current includes the current branch., 2006-01-11)
>
> Yes, the commit should have noticed the invalid combination of
> options were given and errored out.  Since omission of such a check
> lead to a segfaulting bug without producing any useful output, it
> is safe to make it an error to give these options at the same time.

Actually, no, the commit couldn't have been the culprit. Back when 1aa58d6735 was written, "--reflog" option did not even exist.

If we want to find a commit to blame, it is 76a44c5c (show-branch --reflog: show the reflog message at the top., 2007-01-19). That commit should have caught invalid combination. It did attempt to catch some invalid combinations (like --more in the reflog mode), but apparently forgot to notice that --current does not make sense to be used in the new mode it was adding.

Thanks.
Previous: Junio C HamanoNext: Gregory David
Message 3 of 4 in “show-branch: fix SEGFAULT on both --current & --reflog”
  1. show-branch: fix SEGFAULT on both --current & --refloggdd via GitGitGadget, Apr 22, 2022
  2. Junio C HamanoApr 22, 2022
  3. Junio C HamanoApr 22, 2022
  4. Gregory DavidApr 25, 2022

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.