Re: [PATCH v11] checkout: extend --track with a "fetch" mode to refresh start-point
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- May 21, 2026, 09:49 UTC
- Message-ID
- <b8932b27-8006-4b43-b7e5-1fac0fbf42c7@gmail.com>
- In-Reply-To
- <xmqq1pf77kml.fsf@gitster.g>
On 19/05/2026 11:34, Junio C Hamano wrote:
Show 22 quoted lines
> "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes: > >> checkout: --track=fetch >> >> * Find the right remote by checking which remote's fetch refspec maps >> to the user's start-point, instead of assuming the start-point begins >> with the remote's name. This fixes cases where the user has a custom >> refspec mapping into a namespace whose name differs from the remote >> (e.g. fetching from origin into refs/remotes/upstream/*). > > This comment is even before looking at the patch text. After > getting one issue pointed out, I'd expect you to think about related > issues before sending a new round out. > > One. Have you considered the case where the remote-tracking refs > are overlapping, e.g., where "origin" and "upstream" point at > different URLs but they both store in "refs/remotes/upstream/*"? > Perhaps their URLs may textually be different but are pointing > logically at the same place (e.g., one ssh:// the other https:// for > example). > > What should happen? What does happen after you apply this patch?
It would be worth looking at what "git checkout --track" does in that case and seeing if we can share the code.
Thanks
Phillip
Show 9 quoted lines
> >> * For a bare namespace name, follow <namespace>/HEAD first to figure >> out which branch to fetch. > > What should happen if HEAD does not exist? What does happen after > you apply this patch? > > Thanks. >