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

Re: [PATCH 2/4] refs: mostly remove core.preferSymlinkRefs

From
Jeff King <peff@peff.net>
Date
Sep 30, 2024, 19:28 UTC
Message-ID
<20240930192826.GA1803946@coredump.intra.peff.net>
In-Reply-To
<20240918232825.2627999-3-gitster@pobox.com>
On Wed, Sep 18, 2024 at 04:28:23PM -0700, Junio C Hamano wrote:
Show 24 quoted lines
> diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh
> index d369330562..4e517cdc13 100755
> --- a/t/t0600-reffiles-backend.sh
> +++ b/t/t0600-reffiles-backend.sh
> [...]
> @@ -468,26 +468,40 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
>  	esac
>  '
>  
> -test_expect_success SYMLINKS 'symref transaction supports symlinks' '
> +test_expect_success SYMLINKS 'symlinks used as symrefs are still supported' '
>  	test_when_finished "git symbolic-ref -d TEST_SYMREF_HEAD || :" &&
>  	git update-ref refs/heads/new HEAD &&
> -	test_config core.prefersymlinkrefs true &&
> -	cat >stdin <<-EOF &&
> -	start
> -	symref-create TEST_SYMREF_HEAD refs/heads/new
> -	prepare
> -	commit
> -	EOF
> -	git update-ref --no-deref --stdin <stdin 2>stderr &&
> +	# manually do this, as core.prefersymlinkrefs no longer
> +	# affects how a symref is created (as a textual symref).
> +	ln -f -s refs/heads/new .git/TEST_SYMREF_HEAD &&

There are two other tests that probably should get the same treatment. In the patch below I've just deleted them, but I think since they are really about the reading side, they'd probably want a similar manual setup.

diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 2d984eb4c6..72eb5f62e7 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -407,18 +407,6 @@ test_expect_success 'checkout w/--track from tag fails' '
 	test "z$(git rev-parse main^0)" = "z$(git rev-parse HEAD)"
 '
 
-test_expect_success 'detach a symbolic link HEAD' '
-	git checkout main &&
-	git config --bool core.prefersymlinkrefs yes &&
-	git checkout side &&
-	git checkout main &&
-	it=$(git symbolic-ref HEAD) &&
-	test "z$it" = zrefs/heads/main &&
-	here=$(git rev-parse --verify refs/heads/main) &&
-	git checkout side^ &&
-	test "z$(git rev-parse --verify refs/heads/main)" = "z$here"
-'
-
 test_expect_success 'checkout with --track fakes a sensible -b <name>' '
 	git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" &&
 	git update-ref refs/remotes/origin/koala/bear renamer &&
diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 95e9955bca..b4d7206bea 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -50,15 +50,6 @@ test_expect_success 'prompt - branch name' '
 	test_cmp expected "$actual"
 '
 
-test_expect_success SYMLINKS 'prompt - branch name - symlink symref' '
-	printf " (main)" >expected &&
-	test_when_finished "git checkout main" &&
-	test_config core.preferSymlinkRefs true &&
-	git checkout main &&
-	__git_ps1 >"$actual" &&
-	test_cmp expected "$actual"
-'
-
 test_expect_success 'prompt - unborn branch' '
 	printf " (unborn)" >expected &&
 	git checkout --orphan unborn &&


I noticed these because I had a similar proposal long ago, which never
got merged (I don't think because anybody particularly disagreed, but it
fell through the cracks and never got picked up again):

  https://lore.kernel.org/git/20151230065343.GA26964@sigill.intra.peff.net/

What you have here is (modulo the two hunks above) more complete than
what I have, so I don't think there's anything else to try to salvage
from it. A little bit of the history in the linked commit message is
interesting as to how we ended up here, but ultimately not really that
important.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 12 in “deprecating core.preferSymlinkRefs”
  1. 0/4 deprecating core.preferSymlinkRefsJunio C Hamano, Sep 18, 2024
  2. 1/4 refs: deprecate core.preferSymlinkRefsJunio C Hamano, Sep 18, 2024
  3. Patrick SteinhardtSep 30, 2024
  4. 2/4 refs: mostly remove core.preferSymlinkRefsJunio C Hamano, Sep 18, 2024
  5. Jeff KingSep 30, 2024
  6. Junio C HamanoSep 30, 2024
  7. 3/4 refs: remove NO_SYMLINK_HEADJunio C Hamano, Sep 18, 2024
  8. 4/4 refs: remove the last remnants of core.preferSymlinkRefsJunio C Hamano, Sep 18, 2024
  9. Derrick StoleeSep 18, 2024
  10. Junio C HamanoSep 19, 2024
  11. Patrick SteinhardtSep 30, 2024
  12. Junio C HamanoSep 30, 2024

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.