Subject: Re: [PATCH] checkout: add --fetch to fetch remote before resolving start-point

From: Junio C Hamano <[email-masked]>
Date: Sat, 25 Apr 2026 07:21:20 +0900

"Harald Nordgren via GitGitGadget" <[email-masked]> writes:

> From: Harald Nordgren <[email-masked]>
>
> Add a --fetch option to git checkout and git switch, plus a
> checkout.autoFetch config to enable it by default. When set and the
> start-point argument names a configured remote (either bare, like
> "origin", or prefixed, like "origin/foo"), fetch that remote before
> resolving the ref. Aborts the checkout if the fetch fails.
>
> Signed-off-by: Harald Nordgren <[email-masked]>
> ---

It is true that "checkout" does funny things to special case the
remote-tracking branches, like setting up the branch.<name>.merge
configuration or even inferring the name of the local branch to be
created.  

But I have to say that this one, especially the configuration
variable, goes way too far.  The usual uses of remote-tracking
branch names, e.g.,

    git log -1 origin/master
    git grep frotz origin/master
    git rev-list --count origin/maint..origin/master

to name a specific object all assume and rely on the stability of
them.  Should the configuration cause a fetch to happen before any
of these uses of remote-tracking branches for consistency?