git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, "Clemens Fruhwirth" <clemens@endorphin.org>,
	"Jan Pokorný" <poki@fnusa.cz>,
	"Corentin BOMPARD" <corentin.bompard@etu.univ-lyon1.fr>
Subject: Re: [PATCH v3] pull, fetch: fix segfault in --set-upstream option
Date: Mon, 30 Aug 2021 10:46:48 -0700	[thread overview]
Message-ID: <xmqqilzm4ygn.fsf@gitster.g> (raw)
In-Reply-To: <patch-v3-1.1-68899471206-20210830T144020Z-avarab@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Mon, 30 Aug 2021 16:41:18 +0200")

Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> 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.

  reply	other threads:[~2021-08-30 17:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 15:46 git pull --set-upstream segfaults on branchless repo Clemens Fruhwirth
2021-07-19 10:04 ` Jan Pokorný
2021-07-19 14:30   ` [PATCH] pull, fetch: fix segfault in --set-upstream option Ævar Arnfjörð Bjarmason
2021-07-19 15:17     ` Junio C Hamano
2021-08-23 12:56     ` [PATCH v2] " Ævar Arnfjörð Bjarmason
2021-08-24  7:30       ` Clemens Fruhwirth
2021-08-24  8:49         ` Ævar Arnfjörð Bjarmason
2021-08-30 14:41       ` [PATCH v3] " Ævar Arnfjörð Bjarmason
2021-08-30 17:46         ` Junio C Hamano [this message]
2021-08-31 13:58         ` [PATCH v4] " Ævar Arnfjörð Bjarmason
2021-08-31 16:40           ` Junio C Hamano
2021-08-31 20:20             ` Ævar Arnfjörð Bjarmason
2021-09-01 17:44               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqilzm4ygn.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=clemens@endorphin.org \
    --cc=corentin.bompard@etu.univ-lyon1.fr \
    --cc=git@vger.kernel.org \
    --cc=poki@fnusa.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).