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

Re: [PATCH v5 0/9] Improve odd encoding integration

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 11, 2019, 01:22 UTC
Message-ID
<xmqqlfsnjjf4.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<cover.1573205699.git.congdanhqx@gmail.com>
Doan Tran Cong Danh <congdanhqx@gmail.com> writes:
Show 9 quoted lines
> The series is shifting from fixing test that failed on musl based Linux to
> correct the internal working encoding and output encoding of git-am
> git-cherry-pick git-rebase and git-revert.
>
> Change from v4:
> - Update commit message per review
> - Add test for last 2 patches
> - Notice a breakage with git rebase --rebase-merges (see patch 7)
>
Re: Patch 3, it indeed is a bit sad that out test framework does not
let us "show" what exactly is being executed in the debug/verbose
mode when we use parameterized test helpers. We designed the test
helpers like test_expect_success and test_eval_ so that the eval'ed
block can access the outer variables safely, i.e. "$flag-$old-$new"
can and should be written inside dq for safety, but the variable
names would be all we see in the verbose log because of that.  But
that's not the end of the world ;-)

I do not have a strong opinion on Patch 9 (I agree we need to fall back on something sensible and without any change, the system is quite broken---I do not have a strong opinion on what the fallback should be); I'd love to hear what sequencer folks think.

Overall this round looks quite good.
Thanks, will queue.
Show 133 quoted lines
>
> Doan Tran Cong Danh (9):
>   t0028: eliminate non-standard usage of printf
>   configure.ac: define ICONV_OMITS_BOM if necessary
>   t3900: demonstrate git-rebase problem with multi encoding
>   sequencer: reencode to utf-8 before arrange rebase's todo list
>   sequencer: reencode revert/cherry-pick's todo list
>   sequencer: reencode squashing commit's message
>   sequencer: reencode old merge-commit message
>   sequencer: reencode commit message for am/rebase --show-current-patch
>   sequencer: fallback to sane label in making rebase todo list
>
>  configure.ac                     |  49 ++++++++++++++++++
>  sequencer.c                      |  32 ++++++++----
>  t/t0028-working-tree-encoding.sh |   4 +-
>  t/t3433-rebase-i18n.sh           |  84 +++++++++++++++++++++++++++++++
>  t/t3433/ISO8859-1.txt            | Bin 0 -> 15 bytes
>  t/t3433/eucJP.txt                | Bin 0 -> 68 bytes
>  t/t3900-i18n-commit.sh           |  37 ++++++++++++++
>  7 files changed, 195 insertions(+), 11 deletions(-)
>  create mode 100755 t/t3433-rebase-i18n.sh
>  create mode 100644 t/t3433/ISO8859-1.txt
>  create mode 100644 t/t3433/eucJP.txt
>
> Range-diff against v4:
>  1:  daa0c27d28 =  1:  b3d6c4e720 t0028: eliminate non-standard usage of printf
>  2:  c50964f413 !  2:  fe63a6bc44 configure.ac: define ICONV_OMITS_BOM if necessary
>     @@ Commit message
>      
>              make ICONV_OMITS_BOM=Yes
>      
>     -    However, typing the flag all the time is cumbersome and error-prone.
>     +    However, configure script wasn't taught to detect those systems.
>      
>     -    Add a check into configure script to detect this flag automatically.
>     +    Teach configure to do so.
>      
>          Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
>      
>  3:  47888f236c !  3:  30f15075c4 t3900: demonstrate git-rebase problem with multi encoding
>     @@ t/t3900-i18n-commit.sh: test_commit_autosquash_flags eucJP fixup
>      +	new=$3
>      +	msg=$4
>      +	test_expect_failure "commit --$flag into $old from $new" '
>     -+		git checkout -b '$flag-$old-$new' C0 &&
>     -+		git config i18n.commitencoding '$old' &&
>     -+		echo '$old' >>F &&
>     -+		git commit -a -F "$TEST_DIRECTORY/t3900/'$msg'" &&
>     ++		git checkout -b $flag-$old-$new C0 &&
>     ++		git config i18n.commitencoding $old &&
>     ++		echo $old >>F &&
>     ++		git commit -a -F "$TEST_DIRECTORY"/t3900/$msg &&
>      +		test_tick &&
>      +		echo intermediate stuff >>G &&
>      +		git add G &&
>      +		git commit -a -m "intermediate commit" &&
>      +		test_tick &&
>     -+		git config i18n.commitencoding '$new' &&
>     -+		echo '$new-$flag' >>F &&
>     -+		git commit -a --'$flag' HEAD^ &&
>     ++		git config i18n.commitencoding $new &&
>     ++		echo $new-$flag >>F &&
>     ++		git commit -a --$flag HEAD^ &&
>      +		git rebase --autosquash -i HEAD^^^ &&
>      +		git rev-list HEAD >actual &&
>      +		test_line_count = 3 actual
>  4:  42115f1e33 !  4:  17165b81e5 sequencer: reencode to utf-8 before arrange rebase's todo list
>     @@ Commit message
>          Thus, t3900::test_commit_autosquash_flags is failing on musl libc.
>      
>          Reencode to utf-8 before arranging rebase's todo list.
>     -    By doing this, we also remove a breakage introduced in the previous
>     -    commit.
>     +
>     +    By doing this, we also remove a breakage noticed by a test added in the
>     +    previous commit.
>      
>          Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
>      
>     @@ t/t3900-i18n-commit.sh: test_commit_autosquash_multi_encoding () {
>       	msg=$4
>      -	test_expect_failure "commit --$flag into $old from $new" '
>      +	test_expect_success "commit --$flag into $old from $new" '
>     - 		git checkout -b '$flag-$old-$new' C0 &&
>     - 		git config i18n.commitencoding '$old' &&
>     - 		echo '$old' >>F &&
>     + 		git checkout -b $flag-$old-$new C0 &&
>     + 		git config i18n.commitencoding $old &&
>     + 		echo $old >>F &&
>  5:  5a871d7226 =  5:  40fa759492 sequencer: reencode revert/cherry-pick's todo list
>  6:  1c6194a598 !  6:  ed6cfab5d2 sequencer: reencode squashing commit's message
>     @@ sequencer.c: static int commit_staged_changes(struct repository *r,
>      
>       ## t/t3900-i18n-commit.sh ##
>      @@ t/t3900-i18n-commit.sh: test_commit_autosquash_multi_encoding () {
>     - 	old=$2
>     - 	new=$3
>     - 	msg=$4
>     -+	squash_msg=
>     -+	if test $flag = squash; then
>     -+		squash_msg='
>     -+		subject="squash! $(head -1 expect)" &&
>     -+		printf "\n%s\n" "$subject" >> expect &&
>     -+		'
>     -+	fi
>     - 	test_expect_success "commit --$flag into $old from $new" '
>     - 		git checkout -b '$flag-$old-$new' C0 &&
>     - 		git config i18n.commitencoding '$old' &&
>     -@@ t/t3900-i18n-commit.sh: test_commit_autosquash_multi_encoding () {
>     - 		git commit -a --'$flag' HEAD^ &&
>     + 		git commit -a --$flag HEAD^ &&
>       		git rebase --autosquash -i HEAD^^^ &&
>       		git rev-list HEAD >actual &&
>      -		test_line_count = 3 actual
>      +		test_line_count = 3 actual &&
>     -+		iconv -f '$old' -t utf-8 "$TEST_DIRECTORY/t3900/'$msg'" >expect &&
>     -+		'"$squash_msg"'
>     ++		iconv -f $old -t UTF-8 "$TEST_DIRECTORY"/t3900/$msg >expect &&
>     ++		if test $flag = squash; then
>     ++			subject="$(head -1 expect)" &&
>     ++			printf "\nsquash! %s\n" "$subject" >>expect
>     ++		fi &&
>      +		git cat-file commit HEAD^ >raw &&
>     -+		(sed "1,/^$/d" raw | iconv -f '$new' -t utf-8) >actual &&
>     ++		(sed "1,/^$/d" raw | iconv -f $new -t utf-8) >actual &&
>      +		test_cmp expect actual
>       	'
>       }
>  7:  95df3cdadf <  -:  ---------- sequencer: reencode old merge-commit message
>  8:  0606b2408d <  -:  ---------- sequencer: reencode commit message for am/rebase --show-current-patch
>  -:  ---------- >  7:  def9adf97e sequencer: reencode old merge-commit message
>  -:  ---------- >  8:  2e95ca57d2 sequencer: reencode commit message for am/rebase --show-current-patch
>  -:  ---------- >  9:  860dee65f4 sequencer: fallback to sane label in making rebase todo list
Previous: Doan Tran Cong DanhNext: Junio C Hamano
Message 71 of 89 in “Linux with musl libc improvement”
  1. 0/3 Linux with musl libc improvementDoan Tran Cong Danh, Oct 31, 2019
  2. 1/3 t0028: eliminate non-standard usage of printfDoan Tran Cong Danh, Oct 31, 2019
  3. Jeff KingOct 31, 2019
  4. Danh DoanNov 1, 2019
  5. brian m. carlsonOct 31, 2019
  6. 2/3 configure.ac: define ICONV_OMITS_BOM if necessaryDoan Tran Cong Danh, Oct 31, 2019
  7. Jeff KingOct 31, 2019
  8. brian m. carlsonOct 31, 2019
  9. Danh DoanNov 1, 2019
  10. 3/3 sequencer: reencode to utf-8 before arrange rebase's todo listDoan Tran Cong Danh, Oct 31, 2019
  11. Johannes SchindelinOct 31, 2019
  12. Jeff KingOct 31, 2019
  13. Danh DoanNov 1, 2019
  14. 0/3 Linux with musl libc improvementDoan Tran Cong Danh, Nov 1, 2019
  15. 1/3 t0028: eliminate non-standard usage of printfDoan Tran Cong Danh, Nov 1, 2019
  16. Jeff KingNov 1, 2019
  17. 2/3 configure.ac: define ICONV_OMITS_BOM if necessaryDoan Tran Cong Danh, Nov 1, 2019
  18. Jeff KingNov 1, 2019
  19. Danh DoanNov 2, 2019
  20. 3/3 sequencer: reencode to utf-8 before arrange rebase's todo listDoan Tran Cong Danh, Nov 1, 2019
  21. Jeff KingNov 1, 2019
  22. Danh DoanNov 2, 2019
  23. Danh DoanNov 2, 2019
  24. Jeff KingNov 5, 2019
  25. Junio C HamanoNov 6, 2019
  26. Jeff KingNov 6, 2019
  27. Danh DoanNov 6, 2019
  28. Jeff KingNov 7, 2019
  29. 0/8 Correct internal working and output encodingDoan Tran Cong Danh, Nov 6, 2019
  30. 1/8 t0028: eliminate non-standard usage of printfDoan Tran Cong Danh, Nov 6, 2019
  31. 2/8 configure.ac: define ICONV_OMITS_BOM if necessaryDoan Tran Cong Danh, Nov 6, 2019
  32. 3/8 t3900: demonstrate git-rebase problem with multi encodingDoan Tran Cong Danh, Nov 6, 2019
  33. 4/8 sequencer: reencode to utf-8 before arrange rebase's todo listDoan Tran Cong Danh, Nov 6, 2019
  34. 5/8 sequencer: reencode revert/cherry-pick's todo listDoan Tran Cong Danh, Nov 6, 2019
  35. 6/8 sequencer: reencode squashing commit's messageDoan Tran Cong Danh, Nov 6, 2019
  36. 7/8 sequencer: reencode old merge-commit messageDoan Tran Cong Danh, Nov 6, 2019
  37. Eric SunshineNov 6, 2019
  38. 8/8 sequencer: reencode commit message for am/rebase --show-current-patchDoan Tran Cong Danh, Nov 6, 2019
  39. 0/8 Correct internal working and output encodingDoan Tran Cong Danh, Nov 7, 2019
  40. 1/8 t0028: eliminate non-standard usage of printfDoan Tran Cong Danh, Nov 7, 2019
  41. 2/8 configure.ac: define ICONV_OMITS_BOM if necessaryDoan Tran Cong Danh, Nov 7, 2019
  42. Junio C HamanoNov 7, 2019
  43. 3/8 t3900: demonstrate git-rebase problem with multi encodingDoan Tran Cong Danh, Nov 7, 2019
  44. Jeff KingNov 7, 2019
  45. Danh DoanNov 7, 2019
  46. Jeff KingNov 7, 2019
  47. Danh DoanNov 7, 2019
  48. Jeff KingNov 11, 2019
  49. 4/8 sequencer: reencode to utf-8 before arrange rebase's todo listDoan Tran Cong Danh, Nov 7, 2019
  50. Jeff KingNov 7, 2019
  51. 6/8 sequencer: reencode squashing commit's messageDoan Tran Cong Danh, Nov 7, 2019
  52. Jeff KingNov 7, 2019
  53. 5/8 sequencer: reencode revert/cherry-pick's todo listDoan Tran Cong Danh, Nov 7, 2019
  54. Jeff KingNov 7, 2019
  55. 7/8 sequencer: reencode old merge-commit messageDoan Tran Cong Danh, Nov 7, 2019
  56. 8/8 sequencer: reencode commit message for am/rebase --show-current-patchDoan Tran Cong Danh, Nov 7, 2019
  57. Jeff KingNov 7, 2019
  58. Danh DoanNov 7, 2019
  59. Jeff KingNov 7, 2019
  60. Danh DoanNov 7, 2019
  61. 0/9 Improve odd encoding integrationDoan Tran Cong Danh, Nov 8, 2019
  62. 1/9 t0028: eliminate non-standard usage of printfDoan Tran Cong Danh, Nov 8, 2019
  63. 2/9 configure.ac: define ICONV_OMITS_BOM if necessaryDoan Tran Cong Danh, Nov 8, 2019
  64. 4/9 sequencer: reencode to utf-8 before arrange rebase's todo listDoan Tran Cong Danh, Nov 8, 2019
  65. 3/9 t3900: demonstrate git-rebase problem with multi encodingDoan Tran Cong Danh, Nov 8, 2019
  66. 5/9 sequencer: reencode revert/cherry-pick's todo listDoan Tran Cong Danh, Nov 8, 2019
  67. 6/9 sequencer: reencode squashing commit's messageDoan Tran Cong Danh, Nov 8, 2019
  68. 7/9 sequencer: reencode old merge-commit messageDoan Tran Cong Danh, Nov 8, 2019
  69. 8/9 sequencer: reencode commit message for am/rebase --show-current-patchDoan Tran Cong Danh, Nov 8, 2019
  70. 9/9 sequencer: fallback to sane label in making rebase todo listDoan Tran Cong Danh, Nov 8, 2019
  71. Junio C HamanoNov 11, 2019
  72. Junio C HamanoNov 11, 2019
  73. Danh DoanNov 11, 2019
  74. Junio C HamanoNov 11, 2019
  75. 0/9 sequencer: handle other encoding betterDoan Tran Cong Danh, Nov 11, 2019
  76. 1/9 t0028: eliminate non-standard usage of printfDoan Tran Cong Danh, Nov 11, 2019
  77. 2/9 configure.ac: define ICONV_OMITS_BOM if necessaryDoan Tran Cong Danh, Nov 11, 2019
  78. 3/9 t3900: demonstrate git-rebase problem with multi encodingDoan Tran Cong Danh, Nov 11, 2019
  79. 4/9 sequencer: reencode to utf-8 before arrange rebase's todo listDoan Tran Cong Danh, Nov 11, 2019
  80. 5/9 sequencer: reencode revert/cherry-pick's todo listDoan Tran Cong Danh, Nov 11, 2019
  81. 6/9 sequencer: reencode squashing commit's messageDoan Tran Cong Danh, Nov 11, 2019
  82. 8/9 sequencer: reencode commit message for am/rebase --show-current-patchDoan Tran Cong Danh, Nov 11, 2019
  83. 7/9 sequencer: reencode old merge-commit messageDoan Tran Cong Danh, Nov 11, 2019
  84. 9/9 sequencer: fallback to sane label in making rebase todo listDoan Tran Cong Danh, Nov 11, 2019
  85. Jeff KingNov 11, 2019
  86. Phillip WoodNov 11, 2019
  87. Johannes SchindelinNov 11, 2019
  88. Junio C HamanoNov 12, 2019
  89. Jeff KingNov 11, 2019

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.