* [RFC] pull: custom fetch refspecs and fork-point lookup
@ 2026-10-13 16:01 jyotish kumar
2026-10-14 19:07 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: jyotish kumar @ 2026-10-13 16:01 UTC (permalink / raw)
To: git
Hi,
While reading `builtin/pull.c`, I came across a FIXME in
`get_tracking_branch()` concerning the assumption that remote branches
follow the default mapping from `refs/heads/<branch>` to
`refs/remotes/<remote>/<branch>`.
I investigated how this assumption relates to custom fetch refspecs
and noticed a potentially subtle issue.
For example, a remote can be configured with the following fetch refspec:
`+refs/heads/*:refs/remotes/origin/custom/*`
With this configuration, the remote-tracking ref for the `main` branch
is `refs/remotes/origin/custom/main`, rather than
`refs/remotes/origin/main`.
Since `get_tracking_branch()` is used by `get_rebase_fork_point()`
when determining the fork point for `git pull --rebase`, I am
wondering whether this assumption could cause the fork-point lookup to
use an incorrect or nonexistent remote-tracking ref when a custom
fetch refspec is configured.
From my investigation of Git's remote and refspec APIs, it seems that
resolving the configured fetch mapping may be a more reliable approach
than assuming the default remote-tracking ref layout.
Does this analysis sound correct? I would appreciate feedback on
whether this is a real issue and whether resolving the configured
fetch mapping would be the right direction to address it.
Thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] pull: custom fetch refspecs and fork-point lookup
2026-10-13 16:01 [RFC] pull: custom fetch refspecs and fork-point lookup jyotish kumar
@ 2026-10-14 19:07 ` Junio C Hamano
2026-10-15 7:17 ` Harald Nordgren
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2026-10-14 19:07 UTC (permalink / raw)
To: jyotish kumar; +Cc: git, Harald Nordgren
jyotish kumar <jyotishkumar725015@gmail.com> writes:
> While reading `builtin/pull.c`, I came across a FIXME in
> `get_tracking_branch()` concerning the assumption that remote branches
> follow the default mapping from `refs/heads/<branch>` to
> `refs/remotes/<remote>/<branch>`.
> ...
> Does this analysis sound correct? I would appreciate feedback on
> whether this is a real issue and whether resolving the configured
> fetch mapping would be the right direction to address it.
The reason the "FIXME" you noticed exists is that the assumption the
code makes is broken. Assuming that refs/remotes/<remote>/<branch>
tracks <branch> from <remote> would break when a customized fetch
refspec is used.
I vaguely recall mentioning a similar "map between a remote-tracking
branch and a branch at the remote" issue while discussing a recent
work by Harald to narrow a "git fetch" that does not specify what to
fetch, but I cannot find a mailing list archive reference, sorry.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] pull: custom fetch refspecs and fork-point lookup
2026-10-14 19:07 ` Junio C Hamano
@ 2026-10-15 7:17 ` Harald Nordgren
2026-10-15 10:46 ` jyotish kumar
2026-10-15 17:05 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Harald Nordgren @ 2026-10-15 7:17 UTC (permalink / raw)
To: Junio C Hamano; +Cc: jyotish kumar, git
Yes, seems like a hardcoding bug.
Is this for an in-flight topic that Jyotish is working on, or
something already in master?
Harald
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] pull: custom fetch refspecs and fork-point lookup
2026-10-15 7:17 ` Harald Nordgren
@ 2026-10-15 10:46 ` jyotish kumar
2026-10-15 17:05 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: jyotish kumar @ 2026-10-15 10:46 UTC (permalink / raw)
To: Harald Nordgren; +Cc: Junio C Hamano, git
Hi Harald, Junio,
Thanks for the feedback.
This is an issue I came across while investigating
`get_tracking_branch()` in `builtin/pull.c`. I haven't started working
on a patch yet, and I'm not aware of anyone currently addressing this
issue.
Junio, thanks for pointing out the potentially related discussion. If
you happen to recall any additional details that could help locate it,
that would be helpful.
I will look into the existing discussions and code further before
proceeding with a fix.
Thanks!
On Thu, Oct 15, 2026 at 12:47 PM Harald Nordgren
<haraldnordgren@gmail.com> wrote:
>
> Yes, seems like a hardcoding bug.
>
> Is this for an in-flight topic that Jyotish is working on, or
> something already in master?
>
>
> Harald
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] pull: custom fetch refspecs and fork-point lookup
2026-10-15 7:17 ` Harald Nordgren
2026-10-15 10:46 ` jyotish kumar
@ 2026-10-15 17:05 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2026-10-15 17:05 UTC (permalink / raw)
To: Harald Nordgren; +Cc: jyotish kumar, git
Harald Nordgren <haraldnordgren@gmail.com> writes:
> Yes, seems like a hardcoding bug.
>
> Is this for an in-flight topic that Jyotish is working on, or
> something already in master?
The former. You can see the thread in all its glory at
https://lore.kernel.org/git/CAGjZMyTQt2XEF69pJWHA=diRjoidixGs48E1vA0ytGUgZYOZNQ@mail.gmail.com/
which is (still) quite short.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-15 17:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 16:01 [RFC] pull: custom fetch refspecs and fork-point lookup jyotish kumar
2026-10-14 19:07 ` Junio C Hamano
2026-10-15 7:17 ` Harald Nordgren
2026-10-15 10:46 ` jyotish kumar
2026-10-15 17:05 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox