(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"Test pretty formats">)} spids: [16] ) ] spids: [16] ) (C {(.)} {(./test-lib.sh)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_encoding) op: Equal rhs: {(DQ (ISO8859-1))} spids: [29] ) ] spids: [29] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sample_utf8_part) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(printf)} { (DQ (f) (EscapedLiteralPart token:<Lit_EscapedChar "\\3">) (03) (EscapedLiteralPart token: <Lit_EscapedChar "\\2"> ) (44ng) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [36 46] ) } spids: [35] ) ] spids: [35] ) (FuncDef name: commit_msg body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:msg) op: Equal rhs: { (DQ ("initial. an") (${ VSub_Name sample_utf8_part) (lich) (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) ) } spids: [69] ) ] spids: [69] ) (If arms: [ (if_arm cond: [(C {(test)} {(-n)} {(DQ ($ VSub_Number "$1"))})] action: [ (Pipeline children: [ (C {(printf)} {(DQ ($ VSub_Name "$msg"))}) (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {(DQ ($ VSub_Number "$1"))}) ] negated: False ) ] spids: [-1 91] ) ] else_action: [(C {(printf)} {(DQ ($ VSub_Name "$msg"))})] spids: [115 125] ) ] spids: [54] ) spids: [49 53] ) (C {(test_expect_success)} {(SQ <"set up basic repos">)} { (SQ <"\n"> <"\t>foo &&\n"> <"\t>bar &&\n"> <"\tgit add foo &&\n"> <"\ttest_tick &&\n"> <"\tgit config i18n.commitEncoding $test_encoding &&\n"> <"\tcommit_msg $test_encoding | git commit -F - &&\n"> <"\tgit add bar &&\n"> <"\ttest_tick &&\n"> <"\tgit commit -m \"add bar\" &&\n"> <"\tgit config --unset i18n.commitEncoding\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias builtin format">)} { (SQ <"\n"> <"\tgit log --pretty=oneline >expected &&\n"> <"\tgit config pretty.test-alias oneline &&\n"> <"\tgit log --pretty=test-alias >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias masking builtin format">)} { (SQ <"\n"> <"\tgit log --pretty=oneline >expected &&\n"> <"\tgit config pretty.oneline \"%H\" &&\n"> <"\tgit log --pretty=oneline >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias user-defined format">)} { (SQ <"\n"> <"\tgit log --pretty=\"format:%h\" >expected &&\n"> <"\tgit config pretty.test-alias \"format:%h\" &&\n"> <"\tgit log --pretty=test-alias >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias user-defined tformat with %s (ISO8859-1 encoding)">)} { (SQ <"\n"> <"\tgit config i18n.logOutputEncoding $test_encoding &&\n"> <"\tgit log --oneline >expected-s &&\n"> <"\tgit log --pretty=\"tformat:%h %s\" >actual-s &&\n"> <"\tgit config --unset i18n.logOutputEncoding &&\n"> <"\ttest_cmp expected-s actual-s\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias user-defined tformat with %s (utf-8 encoding)">)} { (SQ <"\n"> <"\tgit log --oneline >expected-s &&\n"> <"\tgit log --pretty=\"tformat:%h %s\" >actual-s &&\n"> <"\ttest_cmp expected-s actual-s\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias user-defined tformat">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%h\" >expected &&\n"> <"\tgit config pretty.test-alias \"tformat:%h\" &&\n"> <"\tgit log --pretty=test-alias >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias non-existent format">)} { (SQ <"\n"> <"\tgit config pretty.test-alias format-that-will-never-exist &&\n"> <"\ttest_must_fail git log --pretty=test-alias\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias of an alias">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%h\" >expected &&\n"> <"\tgit config pretty.test-foo \"tformat:%h\" &&\n"> <"\tgit config pretty.test-bar test-foo &&\n"> <"\tgit log --pretty=test-bar >actual && test_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias masking an alias">)} { (SQ <"\n"> <"\tgit log --pretty=format:\"Two %H\" >expected &&\n"> <"\tgit config pretty.duplicate \"format:One %H\" &&\n"> <"\tgit config --add pretty.duplicate \"format:Two %H\" &&\n"> <"\tgit log --pretty=duplicate >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"alias loop">)} { (SQ <"\n"> <"\tgit config pretty.test-foo test-bar &&\n"> <"\tgit config pretty.test-bar test-foo &&\n"> <"\ttest_must_fail git log --pretty=test-foo\n"> ) } ) (C {(test_expect_success)} {(SQ <"NUL separation">)} { (SQ <"\n"> <"\tprintf \"add bar\\0$(commit_msg)\" >expected &&\n"> <"\tgit log -z --pretty=\"format:%s\" >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"NUL termination">)} { (SQ <"\n"> <"\tprintf \"add bar\\0$(commit_msg)\\0\" >expected &&\n"> <"\tgit log -z --pretty=\"tformat:%s\" >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"NUL separation with --stat">)} { (SQ <"\n"> <"\tstat0_part=$(git diff --stat HEAD^ HEAD) &&\n"> <"\tstat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&\n"> <"\tprintf \"add bar\\n$stat0_part\\n\\0$(commit_msg)\\n$stat1_part\\n\" >expected &&\n"> <"\tgit log -z --stat --pretty=\"format:%s\" >actual &&\n"> <"\ttest_i18ncmp expected actual\n"> ) } ) (C {(test_expect_failure)} {(SQ <"NUL termination with --stat">)} { (SQ <"\n"> <"\tstat0_part=$(git diff --stat HEAD^ HEAD) &&\n"> <"\tstat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) &&\n"> <"\tprintf \"add bar\\n$stat0_part\\n\\0$(commit_msg)\\n$stat1_part\\n0\" >expected &&\n"> <"\tgit log -z --stat --pretty=\"tformat:%s\" >actual &&\n"> <"\ttest_i18ncmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"setup more commits">)} { (SQ <"\n"> <"\ttest_commit \"message one\" one one message-one &&\n"> <"\ttest_commit \"message two\" two two message-two &&\n"> <"\thead1=$(git rev-parse --verify --short HEAD~0) &&\n"> <"\thead2=$(git rev-parse --verify --short HEAD~1) &&\n"> <"\thead3=$(git rev-parse --verify --short HEAD~2) &&\n"> <"\thead4=$(git rev-parse --verify --short HEAD~3)\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%<(40)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\tmessage two Z\n"> <"\tmessage one Z\n"> <"\tadd bar Z\n"> <"\t$(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(40)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tmessage two Z\n"> <"\tmessage one Z\n"> <"\tadd bar Z\n"> <"\t$(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting at the nth column">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t$head1 message two Z\n"> <"\t$head2 message one Z\n"> <"\t$head3 add bar Z\n"> <"\t$head4 $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting at the nth column">)} { (SQ <"\n"> <"\tCOLUMNS=50 git log --pretty=\"tformat:%h %<|(-10)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t$head1 message two Z\n"> <"\t$head2 message one Z\n"> <"\t$head3 add bar Z\n"> <"\t$head4 $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting at the nth column. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %<|(40)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\t$head1 message two Z\n"> <"\t$head2 message one Z\n"> <"\t$head3 add bar Z\n"> <"\t$head4 $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with no padding">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%<(1)%s\" >actual &&\n"> <"\tcat <<-EOF >expected &&\n"> <"\tmessage two\n"> <"\tmessage one\n"> <"\tadd bar\n"> <"\t$(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with no padding. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(1)%s\" >actual &&\n" > <"\tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tmessage two\n"> <"\tmessage one\n"> <"\tadd bar\n"> <"\t$(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with trunc">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-\\EOF >expected &&\n"> <"\tmessage ..\n"> <"\tmessage ..\n"> <"\tadd bar Z\n"> <"\tinitial...\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with trunc. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tmessage ..\n"> <"\tmessage ..\n"> <"\tadd bar Z\n"> <"\tinitial...\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with ltrunc">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t..sage two\n"> <"\t..sage one\n"> <"\tadd bar Z\n"> <"\t..${sample_utf8_part}lich\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with ltrunc. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,ltrunc)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\t..sage two\n"> <"\t..sage one\n"> <"\tadd bar Z\n"> <"\t..${sample_utf8_part}lich\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with mtrunc">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-\\EOF >expected &&\n"> <"\tmess.. two\n"> <"\tmess.. one\n"> <"\tadd bar Z\n"> <"\tinit..lich\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left alignment formatting with mtrunc. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,mtrunc)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tmess.. two\n"> <"\tmess.. one\n"> <"\tadd bar Z\n"> <"\tinit..lich\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%>(40)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\tZ message two\n"> <"\tZ message one\n"> <"\tZ add bar\n"> <"\tZ $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%>(40)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tZ message two\n"> <"\tZ message one\n"> <"\tZ add bar\n"> <"\tZ $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting at the nth column">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t$head1 message two\n"> <"\t$head2 message one\n"> <"\t$head3 add bar\n"> <"\t$head4 $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting at the nth column">)} { (SQ <"\n"> <"\tCOLUMNS=50 git log --pretty=\"tformat:%h %>|(-10)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t$head1 message two\n"> <"\t$head2 message one\n"> <"\t$head3 add bar\n"> <"\t$head4 $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting at the nth column. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\t$head1 message two\n"> <"\t$head2 message one\n"> <"\t$head3 add bar\n"> <"\t$head4 $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting at the nth column with --graph. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --graph --pretty=\"tformat:%h %>|(40)%s\" >actual &&\n" > <"\ticonv -f utf-8 -t $test_encoding >expected <<-EOF &&\n"> <"\t* $head1 message two\n"> <"\t* $head2 message one\n"> <"\t* $head3 add bar\n"> <"\t* $head4 $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting with no padding">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%>(1)%s\" >actual &&\n"> <"\tcat <<-EOF >expected &&\n"> <"\tmessage two\n"> <"\tmessage one\n"> <"\tadd bar\n"> <"\t$(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting with no padding and with --graph">)} { (SQ <"\n"> <"\tgit log --graph --pretty=\"tformat:%>(1)%s\" >actual &&\n"> <"\tcat <<-EOF >expected &&\n"> <"\t* message two\n"> <"\t* message one\n"> <"\t* add bar\n"> <"\t* $(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"right alignment formatting with no padding. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%>(1)%s\" >actual &&\n" > <"\tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tmessage two\n"> <"\tmessage one\n"> <"\tadd bar\n"> <"\t$(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"center alignment formatting">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%><(40)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\tZ message two Z\n"> <"\tZ message one Z\n"> <"\tZ add bar Z\n"> <"\tZ $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"center alignment formatting. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%><(40)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tZ message two Z\n"> <"\tZ message one Z\n"> <"\tZ add bar Z\n"> <"\tZ $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"center alignment formatting at the nth column">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t$head1 message two Z\n"> <"\t$head2 message one Z\n"> <"\t$head3 add bar Z\n"> <"\t$head4 $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"center alignment formatting at the nth column">)} { (SQ <"\n"> <"\tCOLUMNS=70 git log --pretty=\"tformat:%h %><|(-30)%s\" >actual &&\n"> <"\tqz_to_tab_space <<-EOF >expected &&\n"> <"\t$head1 message two Z\n"> <"\t$head2 message one Z\n"> <"\t$head3 add bar Z\n"> <"\t$head4 $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"center alignment formatting at the nth column. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%h %><|(40)%s\" >actual &&\n" > <"\tqz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\t$head1 message two Z\n"> <"\t$head2 message one Z\n"> <"\t$head3 add bar Z\n"> <"\t$head4 $(commit_msg) Z\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"center alignment formatting with no padding">)} { (SQ <"\n"> <"\tgit log --pretty=\"tformat:%><(1)%s\" >actual &&\n"> <"\tcat <<-EOF >expected &&\n"> <"\tmessage two\n"> <"\tmessage one\n"> <"\tadd bar\n"> <"\t$(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:old_head1) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(git)} {(rev-parse)} {(--verify)} {(HEAD) (Lit_Tilde "~") (0)})] ) left_token: <Left_CommandSub "$("> spids: [920 930] ) } spids: [919] ) ] spids: [919] ) (C {(test_expect_success)} {(SQ <"center alignment formatting with no padding. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%><(1)%s\" >actual &&\n" > <"\tcat <<-EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tmessage two\n"> <"\tmessage one\n"> <"\tadd bar\n"> <"\t$(commit_msg)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left/right alignment formatting with stealing">)} { (SQ <"\n"> <"\tgit commit --amend -m short --author \"long long long <long@me.com>\" &&\n"> <"\tgit log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n"> <"\tcat <<-\\EOF >expected &&\n"> <"\tshort long long long\n"> <"\tmessage .. A U Thor\n"> <"\tadd bar A U Thor\n"> <"\tinitial... A U Thor\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"left/right alignment formatting with stealing. i18n.logOutputEncoding">)} { (SQ <"\n"> < "\tgit -c i18n.logOutputEncoding=$test_encoding log --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)% an\" >actual &&\n" > <"\tcat <<-\\EOF | iconv -f utf-8 -t $test_encoding >expected &&\n"> <"\tshort long long long\n"> <"\tmessage .. A U Thor\n"> <"\tadd bar A U Thor\n"> <"\tinitial... A U Thor\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"strbuf_utf8_replace() not producing NUL">)} { (SQ <"\n"> <"\tgit log --color --pretty=\"tformat:%<(10,trunc)%s%>>(10,ltrunc)%C(auto)%d\" |\n"> <"\t\ttest_decode_color |\n"> <"\t\tnul_to_q >actual &&\n"> <"\t! grep Q actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"ISO and ISO-strict date formats display the same values">)} { (SQ <"\n"> <"\tgit log --format=%ai%n%ci |\n"> <"\tsed -e \"s/ /T/; s/ //; s/..\\$/:&/\" >expected &&\n"> <"\tgit log --format=%aI%n%cI >actual &&\n"> <"\ttest_cmp expected actual\n"> ) } ) (C {(test_expect_success)} {(SQ <"set up log decoration tests">)} { (SQ <"\n"> <"\thead1=$(git rev-parse --verify HEAD~0) &&\n"> <"\thead2=$(git rev-parse --verify HEAD~1)\n"> ) } ) (C {(test_expect_success)} {(SQ <"log decoration properly follows tag chain">)} { (SQ <"\n"> <"\tgit tag -a tag1 -m tag1 &&\n"> <"\tgit tag -a tag2 -m tag2 tag1 &&\n"> <"\tgit tag -d tag1 &&\n"> <"\tgit commit --amend -m shorter &&\n"> <"\tgit log --no-walk --tags --pretty=\"%H %d\" --decorate=full >actual &&\n"> <"\tcat <<-EOF >expected &&\n"> <"\t$head1 (tag: refs/tags/tag2)\n"> <"\t$head2 (tag: refs/tags/message-one)\n"> <"\t$old_head1 (tag: refs/tags/message-two)\n"> <"\tEOF\n"> <"\tsort actual >actual1 &&\n"> <"\ttest_cmp expected actual1\n"> ) } ) (C {(test_expect_success)} {(SQ <"clean log decoration">)} { (SQ <"\n"> <"\tgit log --no-walk --tags --pretty=\"%H %D\" --decorate=full >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\t$head1 tag: refs/tags/tag2\n"> <"\t$head2 tag: refs/tags/message-one\n"> <"\t$old_head1 tag: refs/tags/message-two\n"> <"\tEOF\n"> <"\tsort actual >actual1 &&\n"> <"\ttest_cmp expected actual1\n"> ) } ) (C {(test_done)}) ] )