🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.git
7 messages
7 total messages Started by jyotish kumar Tue, 13 Oct 2026 16:01
[RFC] pull: custom fetch refspecs and fork-point lookup
#403
Author: jyotish kumar
Date: Tue, 13 Oct 2026 16:01
34 lines
9731 bytes
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!
Re: [RFC] pull: custom fetch refspecs and fork-point lookup
#539
Author: Junio C Hamano
Date: Wed, 14 Oct 2026 19:07
21 lines
10563 bytes
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.
Re: [RFC] pull: custom fetch refspecs and fork-point lookup
#565
Author: Harald Nordgren
Date: Thu, 15 Oct 2026 07:17
8 lines
8995 bytes
Yes, seems like a hardcoding bug.

Is this for an in-flight topic that Jyotish is working on, or
something already in master?


Harald
Re: [RFC] pull: custom fetch refspecs and fork-point lookup
#573
Author: jyotish kumar
Date: Thu, 15 Oct 2026 10:46
29 lines
9845 bytes
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
Re: [RFC] pull: custom fetch refspecs and fork-point lookup
#612
Author: Junio C Hamano
Date: Thu, 15 Oct 2026 17:05
13 lines
10012 bytes
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.
Re: [RFC] pull: custom fetch refspecs and fork-point lookup
#657
Author: jyotish kumar
Date: Fri, 16 Oct 2026 10:17
33 lines
10009 bytes
Hi Junio,

Thanks for the follow-up.

I followed the link, but it appears to open this same RFC thread. I
may be missing something, but I couldn't locate the related discussion
you mentioned about mapping remote-tracking branches to branches on
the remote.

Could you point me to the relevant message or provide a few more
details about that discussion? I'd like to understand the existing
context before proceeding with a patch.

Thanks!

On Thu, Oct 15, 2026 at 10:35 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> 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.
>
Re: [RFC] pull: custom fetch refspecs and fork-point lookup
#664
Author: Junio C Hamano
Date: Fri, 16 Oct 2026 15:02
15 lines
10283 bytes
jyotish kumar <jyotishkumar725015@gmail.com> writes:

> Hi Junio,
>
> Thanks for the follow-up.
>
> I followed the link, but it appears to open this same RFC thread.

What you are missing is the recipient of the message you are looking
at.  It was answering question by Harald, who asked if the issue
(which I asked him to take a look to see if earlier discussion with
him was relevant) is a topic you are working on or something else,
and the URL was part of answering that it is the former.  Of course,
it would link back to this thread ;-).
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads