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

Re: [PATCH v3 5/5] Testing: provide tests requiring them with ellipses after SHA-1 values

From
Ann T Ropea <bedhanger@gmx.de>
Date
Nov 19, 2017, 18:41 UTC
Message-ID
<20171119184113.16630-5-bedhanger@gmx.de>
In-Reply-To
<20171119184113.16630-1-bedhanger@gmx.de>

Where needed[*1*], we arrange for the environment of a Git invocation to contain the variable

   PRINT_SHA1_ELLIPSIS="yes"

This furnishes ellipses in the output which then matches what is expected.

[Footnote]

*1* We are being overly generous in t4013-diff-various.sh because we do not want to destroy/take apart the here-document. Given that all this a temporary measure, we should get away with it.

Signed-off-by: Ann T Ropea <bedhanger@gmx.de>
---
v2: rename patch series & focus on removal of ellipses
v3: env var instead of config option, use one-line comments where appropriate, preserve indent level
 t/t3040-subprojects-basic.sh | 2 +-
 t/t4013-diff-various.sh      | 6 +++++-
 t/t9300-fast-import.sh       | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/t/t3040-subprojects-basic.sh b/t/t3040-subprojects-basic.sh
index 0a4ff6d824a0..dfd46a5672da 100755
--- a/t/t3040-subprojects-basic.sh
+++ b/t/t3040-subprojects-basic.sh
@@ -19,7 +19,7 @@ test_expect_success 'setup: create subprojects' '
 	git update-index --add sub1 &&
 	git add sub2 &&
 	git commit -q -m "subprojects added" &&
-	git diff-tree --abbrev=5 HEAD^ HEAD |cut -d" " -f-3,5- >current &&
+	PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev=5 HEAD^ HEAD |cut -d" " -f-3,5- >current &&
 	git branch save HEAD &&
 	cat >expected <<-\EOF &&
 	:000000 160000 00000... A	sub1
diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index c515e3e53fee..79f213dddd92 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -131,7 +131,11 @@ do
 	test_expect_success "git $cmd" '
 		{
 			echo "\$ git $cmd"
-			git $cmd |
+			# All invocations receive the env var.
+			# We would destroy the here-doc if we
+			# tried to apply it to only the ones
+			# truly needing it.
+			PRINT_SHA1_ELLIPSIS="yes" git $cmd |
 			sed -e "s/^\\(-*\\)$V\\(-*\\)\$/\\1g-i-t--v-e-r-s-i-o-n\2/" \
 			    -e "s/^\\(.*mixed; boundary=\"-*\\)$V\\(-*\\)\"\$/\\1g-i-t--v-e-r-s-i-o-n\2\"/"
 			echo "\$"
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index d47560b6343d..d93ddd91093e 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -876,7 +876,7 @@ test_expect_success 'L: verify internal tree sorting' '
 	EXPECT_END
 
 	git fast-import <input &&
-	git diff-tree --abbrev --raw L^ L >output &&
+	PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev --raw L^ L >output &&
 	test_cmp expect output
 '
 
-- 
2.13.6
Previous: Eric SunshineNext: Junio C Hamano
Message 23 of 58 in “checkout: describe_detached_head: remove 3dots after committish”
  1. 1/3 checkout: describe_detached_head: remove 3dots after committishAnn T Ropea, Nov 5, 2017
  2. 2/3 Documentation: user-manual: limit potentially confusing usage of 3dots (and 2dots)Ann T Ropea, Nov 5, 2017
  3. 3/3 Documentation: revisions: add note about 3dots usages as continuation indicationsAnn T Ropea, Nov 5, 2017
  4. Junio C HamanoNov 6, 2017
  5. Junio C HamanoNov 6, 2017
  6. Philip OakleyNov 7, 2017
  7. Junio C HamanoNov 7, 2017
  8. Ann T RopeaNov 7, 2017
  9. Philip OakleyNov 7, 2017
  10. Junio C HamanoNov 8, 2017
  11. Philip OakleyNov 9, 2017
  12. Ann T RopeaNov 13, 2017
  13. Ann T RopeaNov 13, 2017
  14. Ann T RopeaNov 13, 2017
  15. Junio C HamanoNov 14, 2017
  16. Ann T RopeaNov 19, 2017
  17. Junio C HamanoNov 20, 2017
  18. Ann T RopeaNov 19, 2017
  19. Ann T RopeaNov 19, 2017
  20. Eric SunshineNov 19, 2017
  21. Ann T RopeaNov 19, 2017
  22. Eric SunshineNov 19, 2017
  23. Ann T RopeaNov 19, 2017
  24. Junio C HamanoNov 20, 2017
  25. Philip OakleyNov 20, 2017
  26. Junio C HamanoNov 22, 2017
  27. Philip OakleyNov 22, 2017
  28. Junio C HamanoNov 24, 2017
  29. Ann T RopeaNov 24, 2017
  30. Ann T RopeaNov 24, 2017
  31. Ann T RopeaNov 24, 2017
  32. Ann T RopeaNov 24, 2017
  33. Ann T RopeaNov 24, 2017
  34. Ann T RopeaNov 24, 2017
  35. Junio C HamanoNov 25, 2017
  36. Junio C HamanoNov 26, 2017
  37. Junio C HamanoNov 26, 2017
  38. Junio C HamanoNov 26, 2017
  39. Ann T RopeaDec 3, 2017
  40. Ann T RopeaDec 3, 2017
  41. Ann T RopeaDec 3, 2017
  42. Ann T RopeaDec 3, 2017
  43. Ann T RopeaDec 3, 2017
  44. Junio C HamanoDec 4, 2017
  45. Ann T RopeaDec 4, 2017
  46. Junio C HamanoDec 5, 2017
  47. Ann T RopeaDec 6, 2017
  48. Junio C HamanoDec 6, 2017
  49. Ann T RopeaDec 6, 2017
  50. Ann T RopeaDec 3, 2017
  51. Ann T RopeaDec 3, 2017
  52. Junio C HamanoDec 4, 2017
  53. Ann T RopeaNov 19, 2017
  54. Junio C HamanoNov 20, 2017
  55. Ann T RopeaNov 13, 2017
  56. Ann T RopeaNov 13, 2017
  57. Ann T RopeaNov 13, 2017
  58. Junio C HamanoNov 14, 2017

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.