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

Re: followRemoteHEAD management question

From
Jeff King <peff@peff.net>
Date
Jun 11, 2026, 06:01 UTC
Message-ID
<20260611060123.GA2187173@coredump.intra.peff.net>
In-Reply-To
<DJ5XE9HC5YNY.33U8AG1GX6ZP0@lfurio.us>
On Thu, Jun 11, 2026 at 12:12:54AM -0400, Matt Hunter wrote:
Show 7 quoted lines
> > Yes, this is a common problem with the remote-config namespace. Defining
> > _any_ key makes the remote "exist", even without a defined url, but that
> > isn't usually the intent.  But we can't distinguish that from the case
> > where you really do want to define a remote without a url (in which case
> > the url is the name of the remote).
> 
> I had no idea a remote like that was supported.  Interesting.

I suspect it is more of an emergent property than something that was carefully designed, but after so many years I'd hesitate to change it (at least without a big warning and deprecation period).

Show 5 quoted lines
> > I think you are on the right track. I can see arguments for or against
> > putting it in fetch.* or remote.*, so you'll have to pick one. ;)
> 
> As stated, I think putting it in fetch.* is more consistent.  I'd be
> curious to hear arguments the other way.

My initial thought is that it might affect clone as well as fetch. But I guess this feature does not kick in for clone, as it has its own logic for handling the remote-tracking HEAD. Though arguably it should be possible to configure it not to create one in the first place.

Show 10 quoted lines
> As for another design decision: I'm leaning toward omitting support for
> the "warn-if-not-$branch" value in fetch.followRemoteHEAD.
> 
> My take on that option as-documented is that it serves more as an
> acknowledgment from the user that "yes, I understand that origin has
> pointed HEAD at foo, please only warn me if it changes" as opposed to the
> user expressing that the branch "foo" is in some way special to them.
> 
> This interpretation feels very remote-dependent and doesn't make sense in
> the context of a default catch-all value to me.

Agreed. I can't think of a reason you'd want it in the global option. And if we're wrong, it is easy to add support later (versus adding it now, finding out that it creates awkward corner cases, and then having the backwards-incompatible change of ripping it out).

-Peff
Previous: Matt HunterNext: Bence Ferdinandy
Message 4 of 38 in “followRemoteHEAD management question”
  1. Matt HunterJun 5, 2026
  2. Jeff KingJun 8, 2026
  3. Matt HunterJun 11, 2026
  4. Jeff KingJun 11, 2026
  5. Bence FerdinandyJun 11, 2026
  6. Matt HunterJun 12, 2026
  7. 0/7 Introduce fetch.followRemoteHEAD config optionMatt Hunter, Jun 12, 2026
  8. 1/7 fetch: fixup set_head advice for warn-if-not-branchMatt Hunter, Jun 12, 2026
  9. 2/7 doc: explain fetchRemoteHEADWarn adviceMatt Hunter, Jun 12, 2026
  10. 3/7 t5510: cleanup remote in followRemoteHEAD dangling ref testMatt Hunter, Jun 12, 2026
  11. 4/7 fetch: rename function report_set_headMatt Hunter, Jun 12, 2026
  12. 5/7 fetch: refactor do_fetch handling of followRemoteHEADMatt Hunter, Jun 12, 2026
  13. 6/7 fetch: add configuration option fetch.followRemoteHEADMatt Hunter, Jun 12, 2026
  14. Matt HunterJun 12, 2026
  15. Junio C HamanoJun 12, 2026
  16. Matt HunterJun 13, 2026
  17. 7/7 fetch: fixup a misaligned commentMatt Hunter, Jun 12, 2026
  18. 0/7 Introduce fetch.followRemoteHEAD config variableMatt Hunter, Jun 16, 2026
  19. 1/7 fetch: fixup set_head advice for warn-if-not-branchMatt Hunter, Jun 16, 2026
  20. 2/7 doc: explain fetchRemoteHEADWarn adviceMatt Hunter, Jun 16, 2026
  21. 3/7 t5510: cleanup remote in followRemoteHEAD dangling ref testMatt Hunter, Jun 16, 2026
  22. 4/7 fetch: rename function report_set_headMatt Hunter, Jun 16, 2026
  23. 5/7 fetch: refactor do_fetch handling of followRemoteHEADMatt Hunter, Jun 16, 2026
  24. 6/7 fetch: add configuration variable fetch.followRemoteHEADMatt Hunter, Jun 16, 2026
  25. 7/7 fetch: fixup a misaligned commentMatt Hunter, Jun 16, 2026
  26. Junio C HamanoJun 16, 2026
  27. Junio C HamanoJun 17, 2026
  28. Matt HunterJun 18, 2026
  29. Junio C HamanoJun 18, 2026
  30. 0/8 Introduce fetch.followRemoteHEAD config variableMatt Hunter, Jun 19, 2026
  31. 3/8 t5510: cleanup remote in followRemoteHEAD dangling ref testMatt Hunter, Jun 19, 2026
  32. 1/8 fetch: fixup set_head advice for warn-if-not-branchMatt Hunter, Jun 19, 2026
  33. 4/8 fetch: rename function report_set_headMatt Hunter, Jun 19, 2026
  34. 5/8 fetch: return 0 on known git_fetch_configMatt Hunter, Jun 19, 2026
  35. 2/8 doc: explain fetchRemoteHEADWarn adviceMatt Hunter, Jun 19, 2026
  36. 6/8 fetch: refactor do_fetch handling of followRemoteHEADMatt Hunter, Jun 19, 2026
  37. 7/8 fetch: add configuration variable fetch.followRemoteHEADMatt Hunter, Jun 19, 2026
  38. 8/8 fetch: fixup a misaligned commentMatt Hunter, Jun 19, 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.