git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v1] remote.c: defer remote.<name>.followRemoteHEAD validation

From
Colin Hinton <colinlewishinton@gmail.com>
Date
Oct 21, 2026, 16:30 UTC
Message-ID
<CAHeTm9N4s744v0bgJJSbPoc4=1omKrhAXNuoY4Wey7FZBw-48A@mail.gmail.com>
In-Reply-To
<DM94QXU2Y6J7.39IGDUTB5XN1L@lfurio.us>
Matt & Junio
Show 5 quoted lines
> I think a better justification is needed for this.  The intent behind
> 'warn-if-not-<branch>' makes much less sense in the context of the fetch
> variable imo, and if it turns out to be problematic, reverting support
> later will be tricky.
>

I don't have a particularly strong justification for this, and was already on the fence about including this change or not. I likely will revert this addition for fetch, and make it so that this only works for remote.

Show 6 quoted lines
> > Messages for an unrecognized or missing value no longer name the
> > fetch. prefix, as the helper now serves both the fetch-level and
> > the remote-level setting.
>
> I agree with Junio that this should be addressed.
>

I also went back and forth on how valuable this is, since if it's a typo it should be clear which variable is incorrect. But being detailed doesn't hurt, and in the event of an empty or " " mistake then it will be even easier to identify the configuration error.

Show 14 quoted lines
> >
> > @@ -139,6 +139,9 @@ remove the value for the `fetch.bundleCreationToken` value before fetching.
> >  `warn`;;
> >       Display a warning if the remote advertises a different `HEAD` than what is
> >       set locally.  Behaves like "create" if the local symbolic-ref doesn't exist.
> > +`warn-if-not-<branch>`;;
> > +     Like "warn", but do not display the warning if the remote's `HEAD`
> > +     is `remotes/<name>/<branch>`.
> >  `always`;;
> >       Silently update `remotes/<name>/HEAD` whenever the remote advertises a new
> >       value.
>
> I like the style change from $branch to <branch>
>

If I am reverting the change to fetch and warn-if-not, I will need to revert the .adoc changes too, but I can make this change back in the remote.adoc if we believe this is an improvement.

Show 7 quoted lines
> > +                             follow_remote_head = get_follow_remote_head(transport->remote->follow_remote_head_raw, &no_warn_branch);
> >                       else if (config->follow_remote_head_seen)
> > -                             follow_remote_head = get_follow_remote_head(config->follow_remote_head_raw);
> > +                             follow_remote_head = get_follow_remote_head(config->follow_remote_head_raw, &no_warn_branch);
>
> A couple more overly-long lines
>

I will clean these up, and the ones Junio mentioned, thanks for pointing these out.

Show 7 quoted lines
> >                       else
> >                               follow_remote_head = BUILTIN_FOLLOW_REMOTE_HEAD_DFLT;
> >               }
>
> By the way, I had previously made a comment about moving the definition
> of 'enum follow_remote_head_settings' over to the fetch file since that
> is now the only place it is relevant.  Do you think it's worth changing?

Given the change I am proposing in remote.c where the enum is no longer used, I do see the value in changing the scope of the enum, I will experiment with this and update this in v2.

-Colin Hinton
Previous: Matt HunterNext: Matt Hunter
Message 4 of 19 in “remote.c: defer remote.<name>.followRemoteHEAD validation”
  1. remote.c: defer remote.<name>.followRemoteHEAD validationColin Hinton, Oct 18, 2026
  2. Junio C HamanoOct 19, 2026
  3. Matt HunterOct 19, 2026
  4. Colin HintonOct 21, 2026
  5. Matt HunterOct 22, 2026
  6. remote.c: defer remote.<name>.followRemoteHEAD validationColin Hinton, Oct 23, 2026
  7. Junio C HamanoOct 23, 2026
  8. Matt HunterOct 24, 2026
  9. Junio C HamanoOct 24, 2026
  10. Junio C HamanoOct 25, 2026
  11. Colin HintonOct 28, 2026
  12. Junio C HamanoOct 28, 2026
  13. Matt HunterOct 30, 2026
  14. Junio C HamanoOct 30, 2026
  15. Matt HunterNov 1, 2026
  16. Junio C HamanoNov 6, 2026
  17. Matt HunterNov 6, 2026
  18. Junio C HamanoNov 6, 2026
  19. Colin HintonNov 8, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.