From: Harald Nordgren Date: Fri, 08 May 2026 22:40:50 GMT Subject: [PATCH] checkout: add --fetch to fetch remote before resolving start-point Message-ID: <20260508224050.97883-1-haraldnordgren@gmail.com> In-Reply-To: > * "--track=inherit,direct" is nonsense and should be rejected > > * currently "--track" has "last one wins" behavior so > "--track=inherit --track=direct" behaves like "--track=direct". We > should probably keep that so that "--track=fetch --track=direct" > behaves like "--track=direct", not "--track=fetch,direct" > > * if "git fetch" fails and the remote tracking ref already exists then > we should print a warning and carry on rather than dying which is more > convenient if the user or remote server are offline. > > * "git checkout --track=fetch origin/branch" should respect > remote.origin.fetch so that we fetch the ref that we're going to > checkout. I wonder if we can share this logic with the code that > sets the upstream branch. > > * "git checkout --track=fetch origin" should only fetch the remote > ref that we're going to checkout, not all the refs from origin. i.e. > it should read origin/HEAD to work out what to fetch. Good points! Harald