(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ <'git shortlog\n'>)} spids: [13] ) ] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <setup>)} { (SQ <'\n'> <'\techo 1 >a1 &&\n'> <'\tgit add a1 &&\n'> <'\ttree=$(git write-tree) &&\n'> <'\tcommit=$(printf "%s\\n" "Test" "" | git commit-tree "$tree") &&\n'> <'\tgit update-ref HEAD "$commit" &&\n'> <'\n'> <'\techo 2 >a1 &&\n'> < '\tgit commit --quiet -m "This is a very, very long first line for the commit message to see if it is wrapped correctly" a1 &&\n' > <'\n'> <'\t# test if the wrapping is still valid\n'> <'\t# when replacing all is by treble clefs.\n'> <'\techo 3 >a1 &&\n'> <'\tgit commit --quiet -m "$(\n'> < '\t\techo "This is a very, very long first line for the commit message to see if it is wrapped correctly" |\n' > <'\t\tsed "s/i/1234/g" |\n'> <'\t\ttr 1234 "\\360\\235\\204\\236")" a1 &&\n'> <'\n'> <'\t# now fsck up the utf8\n'> <'\tgit config i18n.commitencoding non-utf-8 &&\n'> <'\techo 4 >a1 &&\n'> <'\tgit commit --quiet -m "$(\n'> < '\t\techo "This is a very, very long first line for the commit message to see if it is wrapped correctly" |\n' > <'\t\tsed "s/i/1234/g" |\n'> <'\t\ttr 1234 "\\370\\235\\204\\236")" a1 &&\n'> <'\n'> <'\techo 5 >a1 &&\n'> <'\tgit commit --quiet -m "a\t\t\t\t\t\t\t\t12\t34\t56\t78" a1 &&\n'> <'\n'> <'\techo 6 >a1 &&\n'> <'\tgit commit --quiet -m "Commit by someone else" \\\n'> <'\t\t--author="Someone else <not!me>" a1 &&\n'> <'\n'> <'\tcat >expect.template <<-\\EOF\n'> <'\tA U Thor (5):\n'> <'\t SUBJECT\n'> <'\t SUBJECT\n'> <'\t SUBJECT\n'> <'\t SUBJECT\n'> <'\t SUBJECT\n'> <'\n'> <'\tSomeone else (1):\n'> <'\t SUBJECT\n'> <'\n'> <'\tEOF\n'> ) } ) (command.ShFunction name: fuzz body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:file) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [86] ) ] ) (command.Simple words: [ {<sed>} { (DQ <'\n'> <'\t\t\ts/'> ($ Id.VSub_DollarName '$_x40') <'/OBJECT_NAME/g\n'> <'\t\t\ts/'> ($ Id.VSub_DollarName '$_x05') <'/OBJID/g\n'> <'\t\t\ts/^ '> <Id.Lit_BadBackslash '\\'> <'{6'> <Id.Lit_BadBackslash '\\'> <'}[CTa].*/ SUBJECT/g\n'> <'\t\t\ts/^ '> <Id.Lit_BadBackslash '\\'> <'{8'> <Id.Lit_BadBackslash '\\'> <'}[^ ].*/ CONTINUATION/g\n'> <'\t\t'> ) } ] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName '$file'))} ) (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {(DQ ($ Id.VSub_DollarName '$file') <.fuzzy>)} ) ] do_fork: T ) (command.Simple words: [{<sed>} {(DQ <'/CONTINUATION/ d'>)}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {(DQ ($ Id.VSub_DollarName '$file') <.fuzzy>)} ) ] do_fork: T ) ] ) ] ) ) (C {<test_expect_success>} {(SQ <'default output format'>)} { (SQ <'\n'> <'\tgit shortlog HEAD >log &&\n'> <'\tfuzz log >log.predictable &&\n'> <'\ttest_cmp expect.template log.predictable\n'> ) } ) (C {<test_expect_success>} {(SQ <'pretty format'>)} { (SQ <'\n'> <'\tsed s/SUBJECT/OBJECT_NAME/ expect.template >expect &&\n'> <'\tgit shortlog --format="%H" HEAD >log &&\n'> <'\tfuzz log >log.predictable &&\n'> <'\ttest_cmp expect log.predictable\n'> ) } ) (C {<test_expect_success>} {(SQ <--abbrev>)} { (SQ <'\n'> <'\tsed s/SUBJECT/OBJID/ expect.template >expect &&\n'> <'\tgit shortlog --format="%h" --abbrev=5 HEAD >log &&\n'> <'\tfuzz log >log.predictable &&\n'> <'\ttest_cmp expect log.predictable\n'> ) } ) (C {<test_expect_success>} {(SQ <'output from user-defined format is re-wrapped'>)} { (SQ <'\n'> <'\tsed "s/SUBJECT/two lines/" expect.template >expect &&\n'> <'\tgit shortlog --format="two%nlines" HEAD >log &&\n'> <'\tfuzz log >log.predictable &&\n'> <'\ttest_cmp expect log.predictable\n'> ) } ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'shortlog wrapping'>)} { (SQ <'\n'> <'\tcat >expect <<\\EOF &&\n'> <'A U Thor (5):\n'> <' Test\n'> <' This is a very, very long first line for the commit message to see if\n'> <' it is wrapped correctly\n'> < ' Th𝄞s 𝄞s a very, very long f𝄞rst l𝄞ne for the comm𝄞t message to see 𝄞f\n' > <' 𝄞t 𝄞s wrapped correctly\n'> < ' Th\xf8\x9d\x84\x9es \xf8\x9d\x84\x9es a very, very long f\xf8\x9d\x84\x9erst l\xf8\x9d\x84\x9ene for the comm\xf8\x9d\x84\x9et\n' > <' message to see \xf8\x9d\x84\x9ef \xf8\x9d\x84\x9et \xf8\x9d\x84\x9es wrapped correctly\n'> <' a\t\t\t\t\t\t\t\t12\t34\n'> <' 56\t78\n'> <'\n'> <'Someone else (1):\n'> <' Commit by someone else\n'> <'\n'> <'EOF\n'> <'\tgit shortlog -w HEAD >out &&\n'> <'\ttest_cmp expect out\n'> ) } ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'shortlog from non-git directory'>)} { (SQ <'\n'> <'\tgit log --no-expand-tabs HEAD >log &&\n'> <'\tGIT_DIR=non-existing git shortlog -w <log >out &&\n'> <'\ttest_cmp expect out\n'> ) } ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'shortlog can read --format=raw output'>)} { (SQ <'\n'> <'\tgit log --format=raw HEAD >log &&\n'> <'\tGIT_DIR=non-existing git shortlog -w <log >out &&\n'> <'\ttest_cmp expect out\n'> ) } ) (C {<test_expect_success>} {(SQ <'shortlog should add newline when input line matches wraplen'>)} { (SQ <'\n'> <'\tcat >expect <<\\EOF &&\n'> <'A U Thor (2):\n'> <' bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb\n'> <' aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa\n'> <'\n'> <'EOF\n'> <'\tgit shortlog -w >out <<\\EOF &&\n'> <'commit 0000000000000000000000000000000000000001\n'> <'Author: A U Thor <author@example.com>\n'> <'Date: Thu Apr 7 15:14:13 2005 -0700\n'> <'\n'> <' aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa\n'> <'\n'> <'commit 0000000000000000000000000000000000000002\n'> <'Author: A U Thor <author@example.com>\n'> <'Date: Thu Apr 7 15:14:13 2005 -0700\n'> <'\n'> <' bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb\n'> <'\n'> <'EOF\n'> <'\ttest_cmp expect out\n'> ) } ) (command.ShFunction name: iconvfromutf8toiso88591 body: (BraceGroup children: [ (command.Pipeline children: [ (C {<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_Star '$*'))}) (C {<iconv>} {<-f>} {<UTF-8>} {<-t>} {<ISO8859-1>}) ] negated: F ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DSCHO) op: assign_op.Equal rhs: { (DQ <'Jöhännës '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <'Dschö'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' Schindëlin'> ) } spids: [333] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DSCHOE) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$DSCHO') <' <Johannes.Schindelin@gmx.de>'>)} spids: [342] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MSG1) op: assign_op.Equal rhs: {(DQ <'set a1 to 2 and some non-ASCII chars: Äßø'>)} spids: [348] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MSG2) op: assign_op.Equal rhs: {(DQ <'set a1 to 3 and some non-ASCII chars: áæï'>)} spids: [353] ) ] ) (command.Simple words: [{<cat>}] redirects: [ (redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect>}) (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<EOF>} here_end_span_id: 378 stdin_parts: [ ($ Id.VSub_DollarName '$DSCHO') <' (2):\n'> <' '> ($ Id.VSub_DollarName '$MSG1') <'\n'> <' '> ($ Id.VSub_DollarName '$MSG2') <'\n'> <'\n'> ] ) ) ] do_fork: T ) (C {<test_expect_success>} {<Id.KW_Bang '!'> <MINGW>} {(SQ <'shortlog encoding'>)} { (SQ <'\n'> <'\tgit reset --hard "$commit" &&\n'> <'\tgit config --unset i18n.commitencoding &&\n'> <'\techo 2 > a1 &&\n'> <'\tgit commit --quiet -m "$MSG1" --author="$DSCHOE" a1 &&\n'> <'\tgit config i18n.commitencoding "ISO8859-1" &&\n'> <'\techo 3 > a1 &&\n'> <'\tgit commit --quiet -m "$(iconvfromutf8toiso88591 "$MSG2")" \\\n'> <'\t\t--author="$(iconvfromutf8toiso88591 "$DSCHOE")" a1 &&\n'> <'\tgit config --unset i18n.commitencoding &&\n'> <'\tgit shortlog HEAD~2.. > out &&\n'> <'test_cmp expect out'> ) } ) (C {<test_expect_success>} {(SQ <'shortlog with revision pseudo options'>)} { (SQ <'\n'> <'\tgit shortlog --all &&\n'> <'\tgit shortlog --branches &&\n'> <'\tgit shortlog --exclude=refs/heads/m* --all\n'> ) } ) (C {<test_expect_success>} {(SQ <'shortlog with --output=<file>'>)} { (SQ <'\n'> <'\tgit shortlog --output=shortlog -1 master >output &&\n'> <'\ttest ! -s output &&\n'> <'\ttest_line_count = 3 shortlog\n'> ) } ) (C {<test_done>}) ] )