From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a1-smtp.messagingengine.com (fout-a1-smtp.messagingengine.com [103.168.172.144]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F3F52DCF46 for ; Thu, 25 Jun 2026 21:16:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.144 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782422218; cv=none; b=Zov3q+qfi1TzAth34jJOWEcj/ImkqNBynDtoooErYDwOCVgtdkKFnc+JmUVgyX2+9tMUO4MY7KMxwbYUAUQ9DLV68QmkAPSHl51udHL4WE/Nad26x5WNJxObeBJ5DWyBfM1AqrRZcrkqW5wAVmlfC6xeX0BKR9a+qqNfEIVswAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782422218; c=relaxed/simple; bh=KWoFbG6BjAybcURFzOCTDx1FERG8Yoddctrp55vUR2M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Fhn4oJhQpiXTsZCeAi1dBqu0yJyh74NQ37w3w5gW11kztYTxl/JJY+GieW+CsSDG9fYfKAS2dEpuFWRqXsDfsY0XMWwXJPuKxKVqL8IZrijQND7uY4Ze9/d5nmYTZ1hkrS3yODfhBgKIIq+8EgqsnPWNnpwovCWMZ4Z7PIbv4AA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=UYBvjhW1; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=IQEF/5y/; arc=none smtp.client-ip=103.168.172.144 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="UYBvjhW1"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="IQEF/5y/" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 5DAB2EC0325; Thu, 25 Jun 2026 17:16:56 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-02.internal (MEProxy); Thu, 25 Jun 2026 17:16:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1782422216; x=1782508616; bh=eQZPZf4Stx 3fDUopijG0M4HX0WFvNBv3IDR9LhrURgU=; b=UYBvjhW1k1wMU6lwZ+Nb07+82Q KdtFxOPUMnKv21djjASbydYEElIeePeB/NtYK1Zimd+6der99yDuOFxJFBh4rU+4 3JdV7wRFXkYcd80EcsbxnwHRtMBJXHCLBa9ih02W5X8d+avSW38kmU783y8/vcC8 j5ZIf1kSEZWDpeFRtnUhOoI2RY0ssMBTTKIua42EA6uIhKkxWKrP5ygPjZKLgiJK 7ZUqPMp6WplQqwY3jZa/GOLGQoOd+p3qO703R9ObFw5oE57Wo98+R6NRfxuP1nQh kSaEDROS6+b8guzV/onDALGA8ErQ89jjP9sGy10qe4RdLfFRHUC2I0YT1RcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1782422216; x=1782508616; bh=eQZPZf4Stx3fDUopijG0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zIZ4Oo1oMzvDQ5Zg X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Jun 2026 17:16:55 -0400 (EDT) From: Junio C Hamano To: Harald Nordgren Cc: Harald Nordgren via GitGitGadget , git@vger.kernel.org Subject: Re: [PATCH v2 1/2] branch: suggest / on upstream slip In-Reply-To: (Harald Nordgren's message of "Thu, 25 Jun 2026 09:44:12 +0200") References: <11bcecebf43797a889f08e79401370f43b2917a8.1782338114.git.gitgitgadget@gmail.com> Date: Thu, 25 Jun 2026 14:16:54 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Harald Nordgren writes: >> Do we still need the _if_enabled() thing here? Isn't the caller >> gated with the same condition in this version? >> >> > + strbuf_release(&remote_ref); >> > + exit(code); >> > +} >> > + >> > int cmd_branch(int argc, >> > const char **argv, >> > const char *prefix, >> > @@ -957,6 +980,9 @@ int cmd_branch(int argc, >> > if (!refs_ref_exists(get_main_ref_store(the_repository), branch->refname)) { >> > if (!argc || branch_checked_out(branch->refname)) >> > die(_("no commit on branch '%s' yet"), branch->name); >> > + if (argc == 1 && >> > + advice_enabled(ADVICE_SET_UPSTREAM_FAILURE)) >> > + die_if_upstream_looks_like_remote(new_upstream, argv[0]); >> > die(_("branch '%s' does not exist"), branch->name); >> > } > > I think we do, so it will give the advice and tell the user that it > can be disabled in the standard format. I was hoping that unconditional advise() should be sufficient, but the caller there needs to say if_enabled, even though it _knows_ that it is enabled, only to give the turn-off instructions. I wonder if future readers would be confused just like I was, without a comment on the callsite of _if_enabled() added by this patch? Thanks.