All of lore.kernel.org
 help / color / mirror / Atom feed
* followRemoteHEAD management question
@ 2026-06-05 16:31 Matt Hunter
  2026-06-08 23:49 ` Jeff King
  2026-06-12  5:55 ` [PATCH 0/7] Introduce fetch.followRemoteHEAD config option Matt Hunter
  0 siblings, 2 replies; 16+ messages in thread
From: Matt Hunter @ 2026-06-05 16:31 UTC (permalink / raw)
  To: git; +Cc: Bence Ferdinandy

Hello git list,

In the past, I've preferred to run 'git remote set-head <name> -d' when
setting up a new repository, since I generally have an awareness of what
the remote default branch is, and I don't like seeing them in branch
listings or git-log annotations.  They are especially noisy to me if I
have multiple remotes.  It's possible this config is ill-advised - I
would love to be educated if so...

However, since b7f7d16562c3 (fetch: add configuration for set_head
behaviour), these changes are undone by every 'git fetch'.

The topic mentioned above (merged in a1f34d595503) adds a new
configuration key 'remote.<name>.followRemoteHEAD'.  I'm assuming that
the intended use for followRemoteHEAD is really only in local /
per-repository config, since trying to apply it to my personal
.gitconfig has some odd behavior.

The <name> in the key template does not accept a wildcard, so I must
list out each of the common remote names I use across different
repositories.  Since many of my repos don't actually have remotes
established for all of these names, they pick up a kind of half-baked
definition for each of them as git performs its config parsing.  For
instance, a name will appear under 'git remote -v', but it won't
have any actual properties configured.

I'd like to add a line to my config somewhere that can globally restore
the old behavior in this context, eg:

    git config --global remote.*.followRemoteHEAD never

instead of adding individual entries to each project's .git/config.

Is there another solution in place I've missed?  If not, would there be
any opposition to a new key like 'remote.followRemoteHEAD' which serves
to provide a default value for any remote that doesn't have its own
'remote.<name>.followRemoteHEAD' key?

I've started scouting out changes to make for such a patch.  It's not
ready yet, but I figured I would throw this question out in case an easy
answer can save the effort.

Thanks

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-06-12 14:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-05 16:31 followRemoteHEAD management question Matt Hunter
2026-06-08 23:49 ` Jeff King
2026-06-11  4:12   ` Matt Hunter
2026-06-11  6:01     ` Jeff King
2026-06-11 20:36       ` Bence Ferdinandy
2026-06-12  6:11         ` Matt Hunter
2026-06-12  5:55 ` [PATCH 0/7] Introduce fetch.followRemoteHEAD config option Matt Hunter
2026-06-12  5:55   ` [PATCH 1/7] fetch: fixup set_head advice for warn-if-not-branch Matt Hunter
2026-06-12  5:55   ` [PATCH 2/7] doc: explain fetchRemoteHEADWarn advice Matt Hunter
2026-06-12  5:55   ` [PATCH 3/7] t5510: cleanup remote in followRemoteHEAD dangling ref test Matt Hunter
2026-06-12  5:55   ` [PATCH 4/7] fetch: rename function report_set_head Matt Hunter
2026-06-12  5:55   ` [PATCH 5/7] fetch: refactor do_fetch handling of followRemoteHEAD Matt Hunter
2026-06-12  5:55   ` [PATCH 6/7] fetch: add configuration option fetch.followRemoteHEAD Matt Hunter
2026-06-12 14:00     ` Matt Hunter
2026-06-12 14:17     ` Junio C Hamano
2026-06-12  5:55   ` [PATCH 7/7] fetch: fixup a misaligned comment Matt Hunter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.