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

Re: [PATCH v3] pull, fetch: fix segfault in --set-upstream option

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2021, 17:46 UTC
Message-ID
<xmqqilzm4ygn.fsf@gitster.g>
In-Reply-To
<patch-v3-1.1-68899471206-20210830T144020Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 5 quoted lines
> There was an earlier submitted alternate way of fixing this in [1],
> due to that patch breaking threading with the original report at [2] I
> didn't notice it before authoring this version. I think the more
> detailed warning message here is better, and we should also have tests
> for this behavior.

I do not think it is necessarily an improvement to give more info, if it is irrelevant to explain what the error is. And the point of the error message here is that we cannot set the upstream of detached HEAD, no matter what the value of old source ref or new source ref are.

The original from Clemens gives a warning message that omits the piece of information that does not contribute to the error.

Testing the new behaviour is a good idea. I also agree with you that die() would be more appropriate and does not risk regression, if the original behaviour was to segfault.

Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 9 of 13 in “git pull --set-upstream segfaults on branchless repo.”
  1. Clemens FruhwirthJul 5, 2021
  2. Jan PokornýJul 19, 2021
  3. pull, fetch: fix segfault in --set-upstream optionÆvar Arnfjörð Bjarmason, Jul 19, 2021
  4. Junio C HamanoJul 19, 2021
  5. pull, fetch: fix segfault in --set-upstream optionÆvar Arnfjörð Bjarmason, Aug 23, 2021
  6. Clemens FruhwirthAug 24, 2021
  7. Ævar Arnfjörð BjarmasonAug 24, 2021
  8. pull, fetch: fix segfault in --set-upstream optionÆvar Arnfjörð Bjarmason, Aug 30, 2021
  9. Junio C HamanoAug 30, 2021
  10. pull, fetch: fix segfault in --set-upstream optionÆvar Arnfjörð Bjarmason, Aug 31, 2021
  11. Junio C HamanoAug 31, 2021
  12. Ævar Arnfjörð BjarmasonAug 31, 2021
  13. Junio C HamanoSep 1, 2021

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.