git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] dangling symrefs and fetchRemoteHEAD=create
@ 2025-08-19 19:20 Jeff King
  2025-08-19 19:23 ` Jeff King
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Jeff King @ 2025-08-19 19:20 UTC (permalink / raw)
  To: git; +Cc: Patrick Steinhardt

This fixes a bug I found while investigating another semi-related bug
(that has already been fixed by Patrick), mentioned in the "PS" here:

  https://lore.kernel.org/git/20250724104536.GA1316505@coredump.intra.peff.net/

The issue is that:

  git remote add -m does-not-exist origin <url>
  git config remote.origin.followRemoteHEAD create
  git fetch

will overwrite the refs/remotes/origin/HEAD we created, even though we
asked it to do so only on creation. The issue is actually in the refs
code, and how it perceives dangling symrefs with respect to creation
events. And so this actually affects "update-ref", as well.

A fix is in the final patch, along with a detailed explanation. The
earlier patches are just cleanup of the related test script before we
add our new test there.

  [1/4]: t5510: make confusing config cleanup more explicit
  [2/4]: t5510: stop changing top-level working directory
  [3/4]: t5510: prefer "git -C" to subshell for followRemoteHEAD tests
  [4/4]: refs: do not clobber dangling symrefs

 refs/files-backend.c    |  34 ++-
 refs/reftable-backend.c |  30 ++-
 t/t1400-update-ref.sh   |  21 ++
 t/t5510-fetch.sh        | 543 ++++++++++++++++++----------------------
 4 files changed, 319 insertions(+), 309 deletions(-)

-Peff

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

end of thread, other threads:[~2025-09-23 17:33 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 19:20 [PATCH 0/4] dangling symrefs and fetchRemoteHEAD=create Jeff King
2025-08-19 19:23 ` Jeff King
2025-08-19 19:24 ` [PATCH 1/4] t5510: make confusing config cleanup more explicit Jeff King
2025-08-19 20:03   ` Eric Sunshine
2025-08-19 20:16     ` Eric Sunshine
2025-08-19 20:53     ` Jeff King
2025-08-19 19:26 ` [PATCH 2/4] t5510: stop changing top-level working directory Jeff King
2025-08-19 19:27 ` [PATCH 3/4] t5510: prefer "git -C" to subshell for followRemoteHEAD tests Jeff King
2025-08-24 19:41   ` SZEDER Gábor
2025-08-25 15:46     ` Junio C Hamano
2025-08-26  3:44       ` Jeff King
2025-08-26 14:58         ` Junio C Hamano
2025-08-19 19:29 ` [PATCH 4/4] refs: do not clobber dangling symrefs Jeff King
2025-08-20  7:27   ` Patrick Steinhardt
2025-08-20 19:14     ` Jeff King
2025-09-22 12:23   ` Toon Claes
2025-09-22 15:54     ` Junio C Hamano
2025-09-22 17:21       ` Jeff King
2025-09-22 17:35         ` Junio C Hamano
2025-09-22 17:12     ` Jeff King
2025-09-23  9:36       ` Toon Claes
2025-09-23 17:33         ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).