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

[PATCH v6 3/5] t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs

From
Alexey Shumkin <alex.crezoff@gmail.com>
Date
Jun 25, 2013, 08:55 UTC
Message-ID
<21a6f94ba53a1e130fd2153af46aae7467f6e0b5.1372149305.git.Alex.Crezoff@gmail.com>
In-Reply-To
<cover.1372149305.git.Alex.Crezoff@gmail.com>

The expected SHA-1 digests are always available in variables. Use them instead of hardcoding.

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
---
 t/t4205-log-pretty-formats.sh | 48 +++++++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 22 deletions(-)
diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
index 26fbfde..73ba5e8 100755
--- a/t/t4205-log-pretty-formats.sh
+++ b/t/t4205-log-pretty-formats.sh
@@ -101,7 +101,11 @@ test_expect_failure 'NUL termination with --stat' '
 
 test_expect_success 'setup more commits' '
 	test_commit "message one" one one message-one &&
-	test_commit "message two" two two message-two
+	test_commit "message two" two two message-two &&
+	head1=$(git rev-parse --verify --short HEAD~0) &&
+	head2=$(git rev-parse --verify --short HEAD~1) &&
+	head3=$(git rev-parse --verify --short HEAD~2) &&
+	head4=$(git rev-parse --verify --short HEAD~3)
 '
 
 test_expect_success 'left alignment formatting' '
@@ -117,18 +121,18 @@ EOF
 	test_cmp expected actual
 '
 
-test_expect_success 'left alignment formatting at the nth column' '
-	git log --pretty="format:%h %<|(40)%s" >actual &&
+test_expect_success 'left alignment formatting at the nth column' "
+	git log --pretty='format:%h %<|(40)%s' >actual &&
 	# complete the incomplete line at the end
 	echo >>actual &&
 	qz_to_tab_space <<\EOF >expected &&
-fa33ab1 message two                    Z
-7cd6c63 message one                    Z
-1711bf9 add bar                        Z
-af20c06 initial                        Z
+$head1 message two                    Z
+$head2 message one                    Z
+$head3 add bar                        Z
+$head4 initial                        Z
 EOF
 	test_cmp expected actual
-'
+"
 
 test_expect_success 'left alignment formatting with no padding' '
 	git log --pretty="format:%<(1)%s" >actual &&
@@ -195,18 +199,18 @@ EOF
 	test_cmp expected actual
 '
 
-test_expect_success 'right alignment formatting at the nth column' '
-	git log --pretty="format:%h %>|(40)%s" >actual &&
+test_expect_success 'right alignment formatting at the nth column' "
+	git log --pretty='format:%h %>|(40)%s' >actual &&
 	# complete the incomplete line at the end
 	echo >>actual &&
 	qz_to_tab_space <<\EOF >expected &&
-fa33ab1                      message two
-7cd6c63                      message one
-1711bf9                          add bar
-af20c06                          initial
+$head1                      message two
+$head2                      message one
+$head3                          add bar
+$head4                          initial
 EOF
 	test_cmp expected actual
-'
+"
 
 test_expect_success 'right alignment formatting with no padding' '
 	git log --pretty="format:%>(1)%s" >actual &&
@@ -234,18 +238,18 @@ EOF
 	test_cmp expected actual
 '
 
-test_expect_success 'center alignment formatting at the nth column' '
-	git log --pretty="format:%h %><|(40)%s" >actual &&
+test_expect_success 'center alignment formatting at the nth column' "
+	git log --pretty='format:%h %><|(40)%s' >actual &&
 	# complete the incomplete line at the end
 	echo >>actual &&
 	qz_to_tab_space <<\EOF >expected &&
-fa33ab1           message two          Z
-7cd6c63           message one          Z
-1711bf9             add bar            Z
-af20c06             initial            Z
+$head1           message two          Z
+$head2           message one          Z
+$head3             add bar            Z
+$head4             initial            Z
 EOF
 	test_cmp expected actual
-'
+"
 
 test_expect_success 'center alignment formatting with no padding' '
 	git log --pretty="format:%><(1)%s" >actual &&
-- 
1.8.3.1.15.g5c23c1e
Previous: Alexey ShumkinNext: Alexey Shumkin
Message 35 of 82 in “pretty: Add failing tests: user format ignores i18n.logOutputEncoding setting”
  1. 1/2 pretty: Add failing tests: user format ignores i18n.logOutputEncoding settingAlexey Shumkin, Sep 20, 2011
  2. 2/2 pretty: user format ignores i18n.logOutputEncoding settingAlexey Shumkin, Sep 20, 2011
  3. Junio C HamanoSep 20, 2011
  4. Alexey ShumkinSep 20, 2011
  5. 0/4 Reroll patches against v1.8.1.1Alexey Shumkin, Jan 24, 2013
  6. 1/4 t6006 (rev-list-format): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jan 24, 2013
  7. Junio C HamanoJan 24, 2013
  8. Alexey ShumkinJan 25, 2013
  9. Alexey ShumkinJan 25, 2013
  10. Junio C HamanoJan 25, 2013
  11. Alexey ShumkinJan 25, 2013
  12. 2/4 t7102 (reset): refactoring: don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jan 24, 2013
  13. Junio C HamanoJan 24, 2013
  14. Alexey ShumkinJan 25, 2013
  15. 3/4 pretty: Add failing tests: user format ignores i18n.logOutputEncoding settingAlexey Shumkin, Jan 24, 2013
  16. Junio C HamanoJan 24, 2013
  17. Alexey ShumkinJan 25, 2013
  18. Junio C HamanoJan 24, 2013
  19. Alexey ShumkinJan 25, 2013
  20. 4/4 pretty: user format ignores i18n.logOutputEncoding settingAlexey Shumkin, Jan 24, 2013
  21. 0/5 Reroll patches against v1.8.3.1Alexey Shumkin, Jun 20, 2013
  22. 1/5 t6006 (rev-list-format): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 20, 2013
  23. Junio C HamanoJun 20, 2013
  24. 2/5 t7102 (reset): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 20, 2013
  25. 3/5 t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 20, 2013
  26. Junio C HamanoJun 20, 2013
  27. 4/5 pretty: Add failing tests: user format ignores i18n.logOutputEncoding settingAlexey Shumkin, Jun 20, 2013
  28. Junio C HamanoJun 20, 2013
  29. 5/5 pretty: user format ignores i18n.logOutputEncoding settingAlexey Shumkin, Jun 20, 2013
  30. Junio C HamanoJun 20, 2013
  31. Junio C HamanoJun 20, 2013
  32. 0/5 Reroll patches against v1.8.3.1Alexey Shumkin, Jun 25, 2013
  33. 1/5 t6006 (rev-list-format): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 25, 2013
  34. 2/5 t7102 (reset): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 25, 2013
  35. 3/5 t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 25, 2013
  36. 4/5 pretty: Add failing tests: --format output should honor logOutputEncodingAlexey Shumkin, Jun 25, 2013
  37. 5/5 pretty: --format output should honor logOutputEncodingAlexey Shumkin, Jun 25, 2013
  38. Junio C HamanoJun 25, 2013
  39. Alexey ShumkinJun 26, 2013
  40. Junio C HamanoJun 26, 2013
  41. 0/5 Reroll patches against v1.8.3.1Alexey Shumkin, Jun 26, 2013
  42. 1/5 t6006 (rev-list-format): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 26, 2013
  43. 2/5 t7102 (reset): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 26, 2013
  44. 3/5 t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jun 26, 2013
  45. 4/5 pretty: Add failing tests: --format output should honor logOutputEncodingAlexey Shumkin, Jun 26, 2013
  46. Johannes SixtJul 1, 2013
  47. Alexey ShumkinJul 1, 2013
  48. Johannes SixtJul 2, 2013
  49. Alexey ShumkinJul 3, 2013
  50. 5/5 pretty: --format output should honor logOutputEncodingAlexey Shumkin, Jun 26, 2013
  51. Junio C HamanoJun 26, 2013
  52. 0/5 Reroll patches against Git v1.8.3.2Alexey Shumkin, Jul 1, 2013
  53. 1/5 t6006 (rev-list-format): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jul 1, 2013
  54. 2/5 t7102 (reset): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jul 1, 2013
  55. 3/5 t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputsAlexey Shumkin, Jul 1, 2013
  56. 4/5 pretty: Add failing tests: --format output should honor logOutputEncodingAlexey Shumkin, Jul 1, 2013
  57. Johannes SixtJul 2, 2013
  58. 5/5 pretty: --format output should honor logOutputEncodingAlexey Shumkin, Jul 1, 2013
  59. Junio C HamanoJul 2, 2013
  60. Alexey ShumkinJul 3, 2013
  61. Junio C HamanoJul 3, 2013
  62. 0/5 Incremental updates against 'next' branchAlexey Shumkin, Jul 4, 2013
  63. 1/5 t4041, t4205, t6006, t7102: use iso8859-1 rather than iso-8859-1Alexey Shumkin, Jul 4, 2013
  64. Junio C HamanoJul 5, 2013
  65. Alexey ShumkinJul 5, 2013
  66. Junio C HamanoJul 5, 2013
  67. Alexey ShumkinJul 5, 2013
  68. Junio C HamanoJul 5, 2013
  69. 2/5 t4205: revert back single quotesAlexey Shumkin, Jul 4, 2013
  70. Junio C HamanoJul 5, 2013
  71. 3/5 t4205, t6006, t7102: make functions more readableAlexey Shumkin, Jul 4, 2013
  72. Junio C HamanoJul 5, 2013
  73. Alexey ShumkinJul 5, 2013
  74. Junio C HamanoJul 5, 2013
  75. Alexey ShumkinJul 5, 2013
  76. Junio C HamanoJul 5, 2013
  77. 4/5 t6006: add two more tests for the case i18n.commitEncoding is not setAlexey Shumkin, Jul 4, 2013
  78. Junio C HamanoJul 5, 2013
  79. Junio C HamanoJul 5, 2013
  80. Alexey ShumkinJul 5, 2013
  81. Junio C HamanoJul 5, 2013
  82. 5/5 t4205: avoid using `sed`Alexey Shumkin, Jul 4, 2013

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.