From: Junio C Hamano Date: Tue, 27 Jan 2026 19:29:34 GMT Subject: [PATCH 0/2] Improving advise messages from "switch" Message-ID: <20260127192936.904719-1-gitster@pobox.com> Simon Cheng noticed [*] that "git switch ", in an attempt to create a local branch after a remote tracking branch of the same name, fails correctly when multiple remotes have branches with that name, but gives an advise message to disambiguate using "git checkout". Obviously, the user wanted to use "git switch", and "git switch" is equipped to do so, just like "git checkout" can, so it makes more sense to give hint based on "git switch". The first patch of this series restructures the call chain of checkout, switch, and restore commands a bit, so that a helper deep in the callchain can find out what end-user command it is working for. The second patch takes advantage of the new structure to tweak the advise message in question, given from a helper function in a fairly deep part of the call chain. [Reference] * https://lore.kernel.org/git/CA+itcS0iyqNyzOP0cueLg7B3yadoEr_VWJ-QoL+YPFUPJiE2RQ@mail.gmail.com Junio C Hamano (2): checkout: pass program-readable token to unified "main" checkout: tell "parse_remote_branch" which command is calling it builtin/checkout.c | 92 ++++++++++++++++++++++++++++----------- t/t2027-checkout-track.sh | 21 +++++++++ 2 files changed, 88 insertions(+), 25 deletions(-) -- 2.53.0-rc2-135-gb1217c0133