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

[PATCH v2 1/3] t/t3430: avoid undefined git diff behavior

From
Chris Torek via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 9, 2020, 19:00 UTC
Message-ID
<2ccaad645ff01b786e76dc63210d75da633389a6.1591729224.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.804.v2.git.git.1591729224.gitgitgadget@gmail.com>
From: Chris Torek <chris.torek@gmail.com>

The autosquash-and-exec test used "git diff HEAD^!" to mean "git diff HEAD^ HEAD". Use these directly instead of relying on the undefined but actual-current behavior of "HEAD^!".

Signed-off-by: Chris Torek <chris.torek@gmail.com>
---
 t/t3430-rebase-merges.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index a1bc3e20016..b454f400ebd 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -420,7 +420,7 @@ test_expect_success 'with --autosquash and --exec' '
 	git commit --fixup B B.t &&
 	write_script show.sh <<-\EOF &&
 	subject="$(git show -s --format=%s HEAD)"
-	content="$(git diff HEAD^! | tail -n 1)"
+	content="$(git diff HEAD^ HEAD | tail -n 1)"
 	echo "$subject: $content"
 	EOF
 	test_tick &&
-- 
gitgitgadget
Previous: Chris Torek via GitGitGadgetNext: Chris Torek via GitGitGadget
Message 11 of 26 in “improve git-diff documentation and A...B handling”
  1. 0/3 improve git-diff documentation and A...B handlingChris Torek via GitGitGadget, Jun 9, 2020
  2. 2/3 git diff: improve A...B merge-base handlingChris Torek via GitGitGadget, Jun 9, 2020
  3. Junio C HamanoJun 9, 2020
  4. Philip OakleyJun 12, 2020
  5. Junio C HamanoJun 12, 2020
  6. 1/3 t/t3430: avoid undocumented git diff behaviorChris Torek via GitGitGadget, Jun 9, 2020
  7. Junio C HamanoJun 9, 2020
  8. 3/3 Documentation: tweak git diff help slightlyChris Torek via GitGitGadget, Jun 9, 2020
  9. Junio C HamanoJun 9, 2020
  10. 0/3 improve git-diff documentation and A...B handlingChris Torek via GitGitGadget, Jun 9, 2020
  11. 1/3 t/t3430: avoid undefined git diff behaviorChris Torek via GitGitGadget, Jun 9, 2020
  12. 2/3 git diff: improve A...B merge-base handlingChris Torek via GitGitGadget, Jun 9, 2020
  13. Junio C HamanoJun 9, 2020
  14. 3/3 Documentation: tweak git diff help slightlyChris Torek via GitGitGadget, Jun 9, 2020
  15. Junio C HamanoJun 9, 2020
  16. 0/3 improve git-diff documentation and A...B handlingChris Torek via GitGitGadget, Jun 11, 2020
  17. 1/3 t/t3430: avoid undefined git diff behaviorChris Torek via GitGitGadget, Jun 11, 2020
  18. 2/3 git diff: improve range handlingChris Torek via GitGitGadget, Jun 11, 2020
  19. Chris TorekJun 11, 2020
  20. 3/3 Documentation: usage for diff combined commitsChris Torek via GitGitGadget, Jun 11, 2020
  21. 0/3 improve git-diff documentation and A...B handlingChris Torek via GitGitGadget, Jun 12, 2020
  22. 1/3 t/t3430: avoid undefined git diff behaviorChris Torek via GitGitGadget, Jun 12, 2020
  23. 2/3 git diff: improve range handlingChris Torek via GitGitGadget, Jun 12, 2020
  24. Junio C HamanoJun 12, 2020
  25. Chris TorekJun 12, 2020
  26. 3/3 Documentation: usage for diff combined commitsChris Torek via GitGitGadget, Jun 12, 2020

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.