{"thread":{"id":"66518","subject":"[RFC] pull: custom fetch refspecs and fork-point lookup","startedAt":"2026-10-13T16:01:09Z","lastAt":"2026-10-16T15:02:00Z","messageCount":7,"participants":["jyotish kumar","Junio C Hamano","Harald Nordgren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"554877","messageId":"CAGjZMyTQt2XEF69pJWHA=diRjoidixGs48E1vA0ytGUgZYOZNQ@mail.gmail.com","threadId":"66518","inReplyTo":null,"subject":"[RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"jyotish kumar","fromEmail":"jyotishkumar725015@gmail.com","sentAt":"2026-10-13T16:01:09Z","receivedAt":"2026-10-13T16:01:09Z","isPatch":false,"sender":{"key":"jyotishkumar725015@gmail.com","avatar":null},"body":"Hi,\n\nWhile reading `builtin/pull.c`, I came across a FIXME in\n`get_tracking_branch()` concerning the assumption that remote branches\nfollow the default mapping from `refs/heads/<branch>` to\n`refs/remotes/<remote>/<branch>`.\n\nI investigated how this assumption relates to custom fetch refspecs\nand noticed a potentially subtle issue.\n\nFor example, a remote can be configured with the following fetch refspec:\n\n`+refs/heads/*:refs/remotes/origin/custom/*`\n\nWith this configuration, the remote-tracking ref for the `main` branch\nis `refs/remotes/origin/custom/main`, rather than\n`refs/remotes/origin/main`.\n\nSince `get_tracking_branch()` is used by `get_rebase_fork_point()`\nwhen determining the fork point for `git pull --rebase`, I am\nwondering whether this assumption could cause the fork-point lookup to\nuse an incorrect or nonexistent remote-tracking ref when a custom\nfetch refspec is configured.\n\nFrom my investigation of Git's remote and refspec APIs, it seems that\nresolving the configured fetch mapping may be a more reliable approach\nthan assuming the default remote-tracking ref layout.\n\nDoes this analysis sound correct? I would appreciate feedback on\nwhether this is a real issue and whether resolving the configured\nfetch mapping would be the right direction to address it.\n\nThanks!\n\n"},{"id":"555062","messageId":"xmqq5wz4rthd.fsf@gitster.g","threadId":"66518","inReplyTo":"CAGjZMyTQt2XEF69pJWHA=diRjoidixGs48E1vA0ytGUgZYOZNQ@mail.gmail.com","subject":"Re: [RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-14T19:07:42Z","receivedAt":"2026-10-14T19:07:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"jyotish kumar <jyotishkumar725015@gmail.com> writes:\n\n> While reading `builtin/pull.c`, I came across a FIXME in\n> `get_tracking_branch()` concerning the assumption that remote branches\n> follow the default mapping from `refs/heads/<branch>` to\n> `refs/remotes/<remote>/<branch>`.\n> ...\n> Does this analysis sound correct? I would appreciate feedback on\n> whether this is a real issue and whether resolving the configured\n> fetch mapping would be the right direction to address it.\n\nThe reason the \"FIXME\" you noticed exists is that the assumption the\ncode makes is broken.  Assuming that refs/remotes/<remote>/<branch>\ntracks <branch> from <remote> would break when a customized fetch\nrefspec is used.\n\nI vaguely recall mentioning a similar \"map between a remote-tracking\nbranch and a branch at the remote\" issue while discussing a recent\nwork by Harald to narrow a \"git fetch\" that does not specify what to\nfetch, but I cannot find a mailing list archive reference, sorry.\n\n\n"},{"id":"555118","messageId":"CAHwyqnVX+FBbihdXA2jxDoweKv6wnqr_rtb110uqLrzNVRAZfw@mail.gmail.com","threadId":"66518","inReplyTo":"xmqq5wz4rthd.fsf@gitster.g","subject":"Re: [RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"Harald Nordgren","fromEmail":"haraldnordgren@gmail.com","sentAt":"2026-10-15T07:17:10Z","receivedAt":"2026-10-15T07:17:10Z","isPatch":false,"sender":{"key":"haraldnordgren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9569897?v=4"},"body":"Yes, seems like a hardcoding bug.\n\nIs this for an in-flight topic that Jyotish is working on, or\nsomething already in master?\n\n\nHarald\n\n"},{"id":"555131","messageId":"CAGjZMyT=RPJSbJoq=RbdBXNiK1Tn4p8VnyeyzkZ46F=p43i6Pw@mail.gmail.com","threadId":"66518","inReplyTo":"CAHwyqnVX+FBbihdXA2jxDoweKv6wnqr_rtb110uqLrzNVRAZfw@mail.gmail.com","subject":"Re: [RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"jyotish kumar","fromEmail":"jyotishkumar725015@gmail.com","sentAt":"2026-10-15T10:46:50Z","receivedAt":"2026-10-15T10:46:50Z","isPatch":false,"sender":{"key":"jyotishkumar725015@gmail.com","avatar":null},"body":"Hi Harald, Junio,\n\nThanks for the feedback.\n\nThis is an issue I came across while investigating\n`get_tracking_branch()` in `builtin/pull.c`. I haven't started working\non a patch yet, and I'm not aware of anyone currently addressing this\nissue.\n\nJunio, thanks for pointing out the potentially related discussion. If\nyou happen to recall any additional details that could help locate it,\nthat would be helpful.\n\nI will look into the existing discussions and code further before\nproceeding with a fix.\n\nThanks!\n\nOn Thu, Oct 15, 2026 at 12:47 PM Harald Nordgren\n<haraldnordgren@gmail.com> wrote:\n>\n> Yes, seems like a hardcoding bug.\n>\n> Is this for an in-flight topic that Jyotish is working on, or\n> something already in master?\n>\n>\n> Harald\n\n"},{"id":"555168","messageId":"xmqq4iemq4gy.fsf@gitster.g","threadId":"66518","inReplyTo":"CAHwyqnVX+FBbihdXA2jxDoweKv6wnqr_rtb110uqLrzNVRAZfw@mail.gmail.com","subject":"Re: [RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-15T17:05:33Z","receivedAt":"2026-10-15T17:05:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Harald Nordgren <haraldnordgren@gmail.com> writes:\n\n> Yes, seems like a hardcoding bug.\n>\n> Is this for an in-flight topic that Jyotish is working on, or\n> something already in master?\n\nThe former.  You can see the thread in all its glory at\n\nhttps://lore.kernel.org/git/CAGjZMyTQt2XEF69pJWHA=diRjoidixGs48E1vA0ytGUgZYOZNQ@mail.gmail.com/\n\nwhich is (still) quite short.\n\n\n"},{"id":"555230","messageId":"CAGjZMyR7-_T+maSibej8cHn3wdWcYzbuQ94pmHj=MAdp9g-2OQ@mail.gmail.com","threadId":"66518","inReplyTo":"xmqq4iemq4gy.fsf@gitster.g","subject":"Re: [RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"jyotish kumar","fromEmail":"jyotishkumar725015@gmail.com","sentAt":"2026-10-16T10:17:33Z","receivedAt":"2026-10-16T10:17:33Z","isPatch":false,"sender":{"key":"jyotishkumar725015@gmail.com","avatar":null},"body":"Hi Junio,\n\nThanks for the follow-up.\n\nI followed the link, but it appears to open this same RFC thread. I\nmay be missing something, but I couldn't locate the related discussion\nyou mentioned about mapping remote-tracking branches to branches on\nthe remote.\n\nCould you point me to the relevant message or provide a few more\ndetails about that discussion? I'd like to understand the existing\ncontext before proceeding with a patch.\n\nThanks!\n\nOn Thu, Oct 15, 2026 at 10:35 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Harald Nordgren <haraldnordgren@gmail.com> writes:\n>\n> > Yes, seems like a hardcoding bug.\n> >\n> > Is this for an in-flight topic that Jyotish is working on, or\n> > something already in master?\n>\n> The former.  You can see the thread in all its glory at\n>\n> https://lore.kernel.org/git/CAGjZMyTQt2XEF69pJWHA=diRjoidixGs48E1vA0ytGUgZYOZNQ@mail.gmail.com/\n>\n> which is (still) quite short.\n>\n\n"},{"id":"555243","messageId":"xmqqv771it93.fsf@gitster.g","threadId":"66518","inReplyTo":"CAGjZMyR7-_T+maSibej8cHn3wdWcYzbuQ94pmHj=MAdp9g-2OQ@mail.gmail.com","subject":"Re: [RFC] pull: custom fetch refspecs and fork-point lookup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-16T15:02:00Z","receivedAt":"2026-10-16T15:02:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"jyotish kumar <jyotishkumar725015@gmail.com> writes:\n\n> Hi Junio,\n>\n> Thanks for the follow-up.\n>\n> I followed the link, but it appears to open this same RFC thread.\n\nWhat you are missing is the recipient of the message you are looking\nat.  It was answering question by Harald, who asked if the issue\n(which I asked him to take a look to see if earlier discussion with\nhim was relevant) is a topic you are working on or something else,\nand the URL was part of answering that it is the former.  Of course,\nit would link back to this thread ;-).\n\n\n"}]}