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

[PATCH 1/2] t0014: factor out choice of deprecated commands

From
Jeff King <peff@peff.net>
Date
Jul 28, 2026, 14:37 UTC
Message-ID
<20260728143726.GA41686@coredump.intra.peff.net>
In-Reply-To
<20260728143653.GB11894@coredump.intra.peff.net>

We have a few tests related to aliasing deprecated commands which use "whatchanged" and "pack-redundant", as these are the only two deprecated commands we have. Let's pull those names into variables so that we can refactor the tests without relying on the specific names.

Signed-off-by: Jeff King <peff@peff.net>
---
I pulled this into its own patch because it's so noisy, but it could be
squashed with the subsequent one.
 t/t0014-alias.sh | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh
index 5144b0effd..9d7c737355 100755
--- a/t/t0014-alias.sh
+++ b/t/t0014-alias.sh
@@ -27,17 +27,20 @@ test_expect_success 'looping aliases - internal execution' '
 	test_grep "^fatal: alias loop detected: expansion of" output
 '
 
+deprecated1=whatchanged
+deprecated2=pack-redundant
+
 test_expect_success 'looping aliases - deprecated builtins' '
-	test_config alias.whatchanged pack-redundant &&
-	test_config alias.pack-redundant whatchanged &&
+	test_config alias.$deprecated1 $deprecated2 &&
+	test_config alias.$deprecated2 $deprecated1 &&
 	cat >expect <<-EOF &&
-	${SQ}whatchanged${SQ} is aliased to ${SQ}pack-redundant${SQ}
-	${SQ}pack-redundant${SQ} is aliased to ${SQ}whatchanged${SQ}
-	fatal: alias loop detected: expansion of ${SQ}whatchanged${SQ} does not terminate:
-	  whatchanged <==
-	  pack-redundant ==>
+	${SQ}$deprecated1${SQ} is aliased to ${SQ}$deprecated2${SQ}
+	${SQ}$deprecated2${SQ} is aliased to ${SQ}$deprecated1${SQ}
+	fatal: alias loop detected: expansion of ${SQ}$deprecated1${SQ} does not terminate:
+	  $deprecated1 <==
+	  $deprecated2 ==>
 	EOF
-	test_must_fail git whatchanged -h 2>actual &&
+	test_must_fail git $deprecated1 -h 2>actual &&
 	test_cmp expect actual
 '
 
@@ -90,8 +93,8 @@ test_expect_success 'can alias-shadow via two deprecated builtins' '
 	# some git(1) commands will fail... (see above)
 	test_might_fail git status -h >expect &&
 	test_file_not_empty expect &&
-	test_might_fail git -c alias.whatchanged=pack-redundant \
-		-c alias.pack-redundant=status whatchanged -h >actual &&
+	test_might_fail git -c alias.$deprecated1=$deprecated2 \
+		-c alias.$deprecated2=status $deprecated1 -h >actual &&
 	test_cmp expect actual
 '
 
-- 
2.55.0.749.g30c495c7a6
Previous: Jeff KingNext: Junio C Hamano
Message 6 of 16 in “Failing tests with WITH_BREAKING_CHANGES”
  1. brian m. carlsonJul 28, 2026
  2. Junio C HamanoJul 28, 2026
  3. Phillip WoodJul 28, 2026
  4. Jeff KingJul 28, 2026
  5. 0/2 fix serial tests without/with breaking-changesJeff King, Jul 28, 2026
  6. 1/2 t0014: factor out choice of deprecated commandsJeff King, Jul 28, 2026
  7. Junio C HamanoJul 28, 2026
  8. 2/2 t0014: generate deprecated command names dynamicallyJeff King, Jul 28, 2026
  9. Junio C HamanoJul 28, 2026
  10. Jeff KingJul 28, 2026
  11. brian m. carlsonJul 28, 2026
  12. Phillip WoodJul 29, 2026
  13. Makefile: read configuration earlierbrian m. carlson, Jul 29, 2026
  14. Junio C HamanoJul 30, 2026
  15. Jeff KingJul 30, 2026
  16. Jeff KingJul 30, 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.