(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'git shortlog\n'>)}
          spids: [13]
        )
      ]
      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'>
        )
      }
    )
    (FuncDef
      name: fuzz
      body: 
        (BraceGroup
          children: [
            (AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:file)
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                      spids: [86]
                    )
                  ]
                  spids: [86]
                )
                (SimpleCommand
                  words: [
                    {(sed)}
                    {
                      (DQ ('\n') ('\t\t\ts/') ($ VSub_Name '$_x40') ('/OBJECT_NAME/g\n') ('\t\t\ts/') 
                        ($ VSub_Name '$_x05') ('/OBJID/g\n') ('\t\t\ts/^ ') (Lit_Other '\\') ('{6') (Lit_Other '\\') ('}[CTa].*/      SUBJECT/g\n') 
                        ('\t\t\ts/^ ') (Lit_Other '\\') ('{8') (Lit_Other '\\') ('}[^ ].*/        CONTINUATION/g\n') ('\t\t')
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Less
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$file'))}
                      spids: [115]
                    )
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$file') (.fuzzy))}
                      spids: [120]
                    )
                  ]
                )
                (SimpleCommand
                  words: [{(sed)} {(DQ ('/CONTINUATION/ d'))}]
                  redirects: [
                    (Redir
                      op_id: Redir_Less
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$file') (.fuzzy))}
                      spids: [135]
                    )
                  ]
                )
              ]
            )
          ]
          spids: [83]
        )
      spids: [79 82]
    )
    (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)} {(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\xf0\x9d\x84\x9es \xf0\x9d\x84\x9es a very, very long f\xf0\x9d\x84\x9erst l\xf0\x9d\x84\x9ene for the comm\xf0\x9d\x84\x9et message to see \xf0\x9d\x84\x9ef\n'
          > <'         \xf0\x9d\x84\x9et \xf0\x9d\x84\x9es 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)} {(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)} {(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'>
        )
      }
    )
    (FuncDef
      name: iconvfromutf8toiso88591
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(printf)} {(DQ ('%s'))} {(DQ ($ VSub_Star '$*'))})
                (C {(iconv)} {(-f)} {(UTF-8)} {(-t)} {(ISO8859-1)})
              ]
              negated: F
            )
          ]
          spids: [305]
        )
      spids: [301 304]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DSCHO)
          op: Equal
          rhs: 
            {
              (DQ ('J\xc3\xb6h\xc3\xa4nn\xc3\xabs ') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) 
                ('Dsch\xc3\xb6') (EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' Schind\xc3\xablin')
              )
            }
          spids: [333]
        )
      ]
      spids: [333]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DSCHOE)
          op: Equal
          rhs: {(DQ ($ VSub_Name '$DSCHO') (' <Johannes.Schindelin@gmx.de>'))}
          spids: [342]
        )
      ]
      spids: [342]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:MSG1)
          op: Equal
          rhs: {(DQ ('set a1 to 2 and some non-ASCII chars: \xc3\x84\xc3\x9f\xc3\xb8'))}
          spids: [348]
        )
      ]
      spids: [348]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:MSG2)
          op: Equal
          rhs: {(DQ ('set a1 to 3 and some non-ASCII chars: \xc3\xa1\xc3\xa6\xc3\xaf'))}
          spids: [353]
        )
      ]
      spids: [353]
    )
    (SimpleCommand
      words: [{(cat)}]
      redirects: [
        (Redir op_id:Redir_Great fd:16777215 arg_word:{(expect)} spids:[360])
        (HereDoc
          op_id: Redir_DLess
          fd: 16777215
          body: 
            {
              (DQ ($ VSub_Name '$DSCHO') (' (2):\n') ('      ') ($ VSub_Name '$MSG1') ('\n') ('      ') 
                ($ VSub_Name '$MSG2') ('\n') ('\n')
              )
            }
          do_expansion: True
          here_end: EOF
          was_filled: T
          spids: [364]
        )
      ]
    )
    (C {(test_expect_success)} {(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)})
  ]
)