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

Re: [PATCH v2 1/2] t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is set

From
Junio C Hamano <gitster@pobox.com>
Date
May 16, 2014, 18:49 UTC
Message-ID
<xmqqfvk9a797.fsf@gitster.dls.corp.google.com>
In-Reply-To
<c4c360c3e6760128ae1326b7463da7130b01a7e9.1400254654.git.Alex.Crezoff@gmail.com>
Alexey Shumkin <alex.crezoff@gmail.com> writes:
Show 30 quoted lines
> Pretty format string %<(N,[ml]trunc)>%s truncates subject to a given
> length with an appropriate padding. This works for non-ASCII texts when
> i18n.logOutputEncoding is UTF-8 only (independently of a printed commit
> message encoding) but does not work when i18n.logOutputEncoding is NOT
> UTF-8.
>
> There were no breakages as far as were no tests for the case
> when both a commit message and logOutputEncoding are not UTF-8.
>
> Add failing tests for that which will be fixed in the next patch.
>
> Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
> Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  t/t4205-log-pretty-formats.sh | 169 ++++++++++++++++++++++++++++++++++++++++++
>  t/t6006-rev-list-format.sh    |  75 ++++++++++++++++++-
>  2 files changed, 242 insertions(+), 2 deletions(-)
>
> diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
> index 2a6278b..6791e0d 100755
> --- a/t/t4205-log-pretty-formats.sh
> +++ b/t/t4205-log-pretty-formats.sh
> @@ -153,6 +153,19 @@ EOF
>  	test_cmp expected actual
>  '
>  
> +test_expect_success 'left alignment formatting. i18n.logOutputEncoding' '
> +	git -c i18n.logOutputEncoding=iso8859-1 log --pretty="format:%<(40)%s" >actual &&
> +	# complete the incomplete line at the end
> +	echo >>actual &&

Would it change the meaning of the test if you used tformat: instead of format: (or --format="%<(40)%s")? If it doesn't, it would make it unnecessary to append an extra LF and explain why you do so.

> +	qz_to_tab_space <<EOF | iconv -f utf-8 -t iso8859-1 >expected &&

It is minor but many existing uses of iconv in our tests spell these as UTF-8 and ISO8859-1 in uppercase. I vaguely recall there was a portability concern to favor the ones that are used in existing tests, but probably it no longer matters (I see you added the lowercase one with de6029a2 mid last year), so I am fine if these stay lowercase.

> +	git -c i18n.logOutputEncoding=iso8859-1 log --pretty="format:%<(1)%s" >actual &&
> +	# complete the incomplete line at the end
> +	echo >>actual &&
Likewise for all the other "--pretty=format:" followed by an echo.
Thanks.
Previous: Alexey ShumkinNext: Alexey Shumkin
Message 7 of 25 in “Pretty print truncate does not work”
  1. 0/2 Pretty print truncate does not workAlexey Shumkin, May 16, 2014
  2. 1/2 t4205 (log-pretty-formats): Add failing tests for the case when i18n.logOutputEncoding is setAlexey Shumkin, May 16, 2014
  3. 2/2 pretty.c: format string with truncate respects logOutputEncodingAlexey Shumkin, May 16, 2014
  4. Duy NguyenMay 16, 2014
  5. 0/2 Reroll patch series. Pretty print truncate does not workAlexey Shumkin, May 16, 2014
  6. 1/2 t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is setAlexey Shumkin, May 16, 2014
  7. Junio C HamanoMay 16, 2014
  8. Alexey ShumkinMay 17, 2014
  9. 0/5 Reroll patches. Pretty print truncate does not workAlexey Shumkin, May 19, 2014
  10. 1/5 t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputsAlexey Shumkin, May 19, 2014
  11. 2/5 t4041, t4205, t6006, t7102: Don't hardcode tested encoding valueAlexey Shumkin, May 19, 2014
  12. brian m. carlsonMay 20, 2014
  13. Alexey ShumkinMay 20, 2014
  14. 3/5 t4205 (log-pretty-format): Use `tformat` rather than `format`Alexey Shumkin, May 19, 2014
  15. 4/5 t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is setAlexey Shumkin, May 19, 2014
  16. 5/5 pretty.c: format string with truncate respects logOutputEncodingAlexey Shumkin, May 19, 2014
  17. 0/5 Reroll patches. Pretty print truncate does not workAlexey Shumkin, May 21, 2014
  18. 1/5 t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputsAlexey Shumkin, May 21, 2014
  19. 2/5 t4041, t4205, t6006, t7102: Don't hardcode tested encoding valueAlexey Shumkin, May 21, 2014
  20. 3/5 t4205 (log-pretty-format): Use `tformat` rather than `format`Alexey Shumkin, May 21, 2014
  21. 4/5 t4205, t6006: Add failing tests for the case when i18n.logOutputEncoding is setAlexey Shumkin, May 21, 2014
  22. Ramsay JonesMay 21, 2014
  23. Junio C HamanoMay 21, 2014
  24. 5/5 pretty.c: format string with truncate respects logOutputEncodingAlexey Shumkin, May 21, 2014
  25. 2/2 pretty.c: format string with truncate respects logOutputEncodingAlexey Shumkin, May 16, 2014

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.