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

Re: [PATCH 6/7] fetch: add configuration option fetch.followRemoteHEAD

From
Matt Hunter <m@lfurio.us>
Date
Jun 13, 2026, 02:58 UTC
Message-ID
<DJ7L27FXS2PG.7PMBDY817U4V@lfurio.us>
In-Reply-To
<xmqqik7nj11i.fsf@gitster.g>
On Fri Jun 12, 2026 at 10:17 AM EDT, Junio C Hamano wrote:
>
> By the way, do not call a "configuration variable" a "configuration option".
> Let's keep the vocabulary forcused without using random synonyms.

Noted. I can appreciate that the term "option" may be better reserved for describing command-line options, to avoid confusion.

Is it safe to assume "setting" may be an appropriate alternative to "configuration variable" in some contexts?

Show 10 quoted lines
>
> I think these uses of strcasecmp() are unnecessary and actively
> harms end-user experience.  This is especially true because the
> value given to remote.<name>.followRemoteHEAD is case sensitive.
>
> [...]
>
> Admittedly values to some existing configuration variables may be
> parsed case insensitively but we should aim to fix the mistake in
> the longer term, and we should certainly not add more of them.

Thanks for clarifying the correct form here. The use of strcasecmp() was largely to match surrounding context as I assumed it would meet most people's expectations.

I think a detail like this can be especially confusing since it seems like the parsing for config variable **names** generally is case-insensitive.

Show 15 quoted lines
>
> Is it sensible to die() here?  If you are fetching from somewhere
> without keeping a set of remote-tracking branches for it (i.e., a
> single shot "git fetch https://github.com/gitster/git master"), you
> do not care what garbage value is in fetch.followRemoteHEAD.
> Perhaps the version of Git that is slightly newer than the version
> that ships with this patch defined new valid values that this patch
> does not know about, and such a user who is doing a single-shot
> fetch may have that setting to help them working with their usual
> non-single shot repositories, but they use a newer version of Git
> for such regular work, and they are using slightly old version of
> Git to perform this single-shot fetch.  The point is that the
> configured value will *NOT* be used for such a user, and dying only
> because this piece of code does not understand the configuration that
> will not be used is of dubious value.

Very good point about forward compatibility. Agreed that die() is the wrong call here.

The most sensible thing is probably to leave fetch.followRemoteHEAD UNCONFIGURED if the value is unrecognized, so we fall back to the "create" behavior unless the remote in question defines its own followRemoteHEAD policy.

Will incorporate each of these in the next round, thanks!
Previous: Junio C HamanoNext: Matt Hunter
Message 16 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.