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

Re: [PATCH v3 1/2] pretty: Add failing tests: user format ignores i18n.logOutputEncoding setting

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2011, 19:12 UTC
Message-ID
<7vaa9z6n9p.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1316506892-6072-1-git-send-email-zapped@mail.ru>
Alexey Shumkin <zapped@mail.ru> writes:
Show 5 quoted lines
> diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
> ...
> @@ -48,28 +53,25 @@ head2=$(add_file sm1 foo3)
>  
>  test_expect_success 'modified submodule(forward)' "

As this is [PATCH 1/2], doesn't this patch make this test fail, calling for test_expect_failure here (and then later in 2/2 to be flipped back to test_expect_success)?

Show 10 quoted lines
>  	git diff-index -p --submodule=log HEAD >actual &&
> -	cat >expected <<-EOF &&
> -Submodule sm1 $head1..$head2:
> -  > Add foo3
> -EOF
> +	printf \"Submodule sm1 $head1..$head2:\n\
> +  > Add foo3 ($added foo3)\n\
> +\" > expected &&
>  	test_cmp expected actual
>  "

Hmmm... why printf? Is it worth to force reviewers wonder what would happen if any of these $variables happened to have "%" in them? Are you benefiting from any printf features that you cannot achieve with the original cat?

This hunk and others throughout your patch that change cat with here doc into printf seem to make the tests less legible, at least to me.

Perhaps like this instead, if the "flushed left" of the original looked ugly to your eyes?

@@ -49,27 +54,25 @@ head2=$(add_file sm1 foo3)
 test_expect_success 'modified submodule(forward)' "
 	git diff-index -p --submodule=log HEAD >actual &&
 	cat >expected <<-EOF &&
-Submodule sm1 $head1..$head2:
-  > Add foo3
-EOF
+	Submodule sm1 $head1..$head2:
+	  > Add foo3 ($added foo3)
+	EOF
 	test_cmp expected actual
 "
Previous: Alexey ShumkinNext: Alexey Shumkin
Message 3 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.