(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description spids:[21]) op: Equal rhs: {(SQ <'commit and log output encodings'>)} spids: [21] ) ] spids: [21] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: compare_with body: (command.BraceGroup children: [ (command.AndOr ops: [Op_DAmp] children: [ (command.Pipeline children: [ (C {(git)} {(show)} {(-s)} {($ VSub_Number '$1')}) (command.SimpleCommand words: [{(sed)} {(-e)} {(SQ <'1,/^$/d'>)} {(-e)} {(SQ <'s/^ //'>)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(current)})] ) ] negated: F ) (command.Case to_match: {(DQ ($ VSub_Number '$3'))} arms: [ (case_arm pat_list: [{(SQ )}] action: [(C {(test_cmp)} {(DQ ($ VSub_Number '$2'))} {(current)})] spids: [79 81 92 16777215] ) (case_arm pat_list: [{(Lit_Other '?') (Lit_Other '*')}] action: [ (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.SimpleCommand words: [{(iconv)} {(-f)} {(DQ ($ VSub_Number '$3'))} {(-t)} {(UTF-8)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(current.utf8)} ) (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(current)} ) ] ) (command.SimpleCommand words: [{(iconv)} {(-f)} {(DQ ($ VSub_Number '$3'))} {(-t)} {(UTF-8)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expect.utf8)} ) (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ ($ VSub_Number '$2'))} ) ] ) (C {(test_cmp)} {(expect.utf8)} {(current.utf8)}) ] ) ] spids: [95 97 151 16777215] ) ] spids: [70 76 154] ) ] ) ] spids: [37] ) spids: [32 36] ) (C {(test_expect_success)} {(setup)} { (SQ <'\n'> <'\t: >F &&\n'> <'\tgit add F &&\n'> <'\tT=$(git write-tree) &&\n'> <'\tC=$(git commit-tree $T <"$TEST_DIRECTORY"/t3900/1-UTF-8.txt) &&\n'> <'\tgit update-ref HEAD $C &&\n'> <'\tgit tag C0\n'> ) } ) (C {(test_expect_success)} {(SQ <'no encoding header for base case'>)} { (SQ <'\n'> <'\tE=$(git cat-file commit C0 | sed -ne "s/^encoding //p") &&\n'> <'\ttest z = "z$E"\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-16 refused because of NULs'>)} { (SQ <'\n'> <'\techo UTF-16 >F &&\n'> <'\ttest_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 invalid characters refused'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\techo "UTF-8 characters" >F &&\n'> <'\tprintf "Commit message\\n\\nInvalid surrogate:\\355\\240\\200\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 overlong sequences rejected'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\trm -f "$HOME/stderr" "$HOME/invalid" &&\n'> <'\techo "UTF-8 overlong" >F &&\n'> <'\tprintf "\\340\\202\\251ommit message\\n\\nThis is not a space:\\300\\240\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 non-characters refused'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\techo "UTF-8 non-character 1" >F &&\n'> <'\tprintf "Commit message\\n\\nNon-character:\\364\\217\\277\\276\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (C {(test_expect_success)} {(SQ <'UTF-8 non-characters refused'>)} { (SQ <'\n'> <'\ttest_when_finished "rm -f $HOME/stderr $HOME/invalid" &&\n'> <'\techo "UTF-8 non-character 2." >F &&\n'> <'\tprintf "Commit message\\n\\nNon-character:\\357\\267\\220\\n" \\\n'> <'\t\t>"$HOME/invalid" &&\n'> <'\tgit commit -a -F "$HOME/invalid" 2>"$HOME"/stderr &&\n'> <'\ttest_i18ngrep "did not conform" "$HOME"/stderr\n'> ) } ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name '$H') (' setup'))} { (SQ <'\n'> <'\t\tgit config i18n.commitencoding $H &&\n'> <'\t\tgit checkout -b $H C0 &&\n'> <'\t\techo $H >F &&\n'> <'\t\tgit commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt\n'> <'\t'> ) } ) ] spids: [281 300] ) spids: [274 16777215] ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ('check encoding header for ') ($ VSub_Name '$H'))} {(SQ <'\n'> <'\t\tE=$(git cat-file commit '>) ($ VSub_Name '$H') (SQ <' | sed -ne "s/^encoding //p") &&\n'> <'\t\ttest "z$E" = "z'>) ($ VSub_Name '$H') (SQ <'"\n'> <'\t'>) } ) ] spids: [315 340] ) spids: [308 16777215] ) (C {(test_expect_success)} {(SQ <'config to remove customization'>)} { (SQ <'\n'> <'\tgit config --unset-all i18n.commitencoding &&\n'> <'\tif Z=$(git config --get-all i18n.commitencoding)\n'> <'\tthen\n'> <'\t\techo Oops, should have failed.\n'> <'\t\tfalse\n'> <'\telse\n'> <'\t\ttest z = "z$Z"\n'> <'\tfi &&\n'> <'\tgit config i18n.commitencoding UTF-8\n'> ) } ) (C {(test_expect_success)} {(SQ <'ISO8859-1 should be shown in UTF-8 now'>)} {(SQ <'\n'> <'\tcompare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt\n'>)} ) (command.ForEach iter_name: H iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name '$H') (' should be shown in UTF-8 now'))} {(SQ <'\n'> <'\t\tcompare_with '>) ($ VSub_Name '$H') (SQ <' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt\n'> <'\t'>) } ) ] spids: [385 405] ) spids: [380 16777215] ) (C {(test_expect_success)} {(SQ <'config to add customization'>)} { (SQ <'\n'> <'\tgit config --unset-all i18n.commitencoding &&\n'> <'\tif Z=$(git config --get-all i18n.commitencoding)\n'> <'\tthen\n'> <'\t\techo Oops, should have failed.\n'> <'\t\tfalse\n'> <'\telse\n'> <'\t\ttest z = "z$Z"\n'> <'\tfi\n'> ) } ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name '$H') (' should be shown in itself now'))} {(SQ <'\n'> <'\t\tgit config i18n.commitencoding '>) ($ VSub_Name '$H') (SQ <' &&\n'> <'\t\tcompare_with '>) ($ VSub_Name '$H') (SQ <' "$TEST_DIRECTORY"/t3900/'>) ($ VSub_Name '$H') (SQ <'.txt\n'> <'\t'>) } ) ] spids: [439 468] ) spids: [432 16777215] ) (C {(test_expect_success)} {(SQ <'config to tweak customization'>)} {(SQ <'\n'> <'\tgit config i18n.logoutputencoding UTF-8\n'>)} ) (C {(test_expect_success)} {(SQ <'ISO8859-1 should be shown in UTF-8 now'>)} {(SQ <'\n'> <'\tcompare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt\n'>)} ) (command.ForEach iter_name: H iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name '$H') (' should be shown in UTF-8 now'))} {(SQ <'\n'> <'\t\tcompare_with '>) ($ VSub_Name '$H') (SQ <' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt\n'> <'\t'>) } ) ] spids: [505 525] ) spids: [500 16777215] ) (command.ForEach iter_name: J iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_Name '$J'))} {(Lit_Other '=')} {(ISO-2022-JP)})] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ICONV spids:[557]) op: Equal rhs: {($ VSub_Name '$J')} spids: [557] ) ] spids: [557] ) ] spids: [16777215 554] ) ] else_action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:ICONV spids:[564]) op: Equal rhs: (word.EmptyWord) spids: [564] ) ] spids: [564] ) ] spids: [561 567] ) (C {(git)} {(config)} {(i18n.logoutputencoding)} {($ VSub_Name '$J')}) (command.ForEach iter_name: H iter_words: [{(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name '$H') (' should be shown in ') ($ VSub_Name '$J') (' now'))} {(SQ <'\n'> <'\t\t\tcompare_with '>) ($ VSub_Name '$H') (SQ <' "$TEST_DIRECTORY"/t3900/'>) ($ VSub_Name '$J') (SQ <'.txt $ICONV\n'> <'\t\t'>) } ) ] spids: [590 617] ) spids: [584 16777215] ) ] spids: [538 619] ) spids: [533 16777215] ) (command.ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)} {(ISO-2022-JP)}] do_arg_iter: F body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ('No conversion with ') ($ VSub_Name '$H'))} {(SQ <'\n'> <'\t\tcompare_with "--encoding=none '>) ($ VSub_Name '$H') (SQ <'" "$TEST_DIRECTORY"/t3900/'>) ($ VSub_Name '$H') (SQ <'.txt\n'> <'\t'>) } ) ] spids: [634 658] ) spids: [627 16777215] ) (command.FuncDef name: test_commit_autosquash_flags body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:H spids:[669]) op: Equal rhs: {($ VSub_Number '$1')} spids: [669] ) ] spids: [669] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:flag spids:[673]) op: Equal rhs: {($ VSub_Number '$2')} spids: [673] ) ] spids: [673] ) (C {(test_expect_success)} {(DQ ('commit --') ($ VSub_Name '$flag') (' with ') ($ VSub_Name '$H') (' encoding'))} { (SQ <'\n'> <'\t\tgit config i18n.commitencoding $H &&\n'> <'\t\tgit checkout -b $H-$flag C0 &&\n'> <'\t\techo $H >>F &&\n'> <'\t\tgit commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&\n'> <'\t\ttest_tick &&\n'> <'\t\techo intermediate stuff >>G &&\n'> <'\t\tgit add G &&\n'> <'\t\tgit commit -a -m "intermediate commit" &&\n'> <'\t\ttest_tick &&\n'> <'\t\techo $H $flag >>F &&\n'> <'\t\tgit commit -a --$flag HEAD~1 &&\n'> <'\t\tE=$(git cat-file commit '> ) ($ VSub_Name '$H') (-) ($ VSub_Name '$flag') (SQ <' |\n'> <'\t\t\tsed -ne "s/^encoding //p") &&\n'> <'\t\ttest "z$E" = "z$H" &&\n'> <'\t\tgit config --unset-all i18n.commitencoding &&\n'> <'\t\tgit rebase --autosquash -i HEAD^^^ &&\n'> <'\t\tgit log --oneline >actual &&\n'> <'\t\ttest_line_count = 3 actual\n'> <'\t'> ) } ) ] spids: [666] ) spids: [661 665] ) (C {(test_commit_autosquash_flags)} {(eucJP)} {(fixup)}) (C {(test_commit_autosquash_flags)} {(ISO-2022-JP)} {(squash)}) (C {(test_done)}) ] )