(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description spids:[21])
          op: Equal
          rhs: {(SQ <'git shortlog\n'>)}
          spids: [21]
        )
      ]
      spids: [21]
    )
    (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.FuncDef
      name: fuzz
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp Op_DAmp]
              children: [
                (command.Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (lhs_expr.LhsName name:file spids:[94])
                      op: Equal
                      rhs: {($ VSub_Number '$1')}
                      spids: [94]
                    )
                  ]
                  spids: [94]
                )
                (command.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.Redir
                      op: <Redir_Less '<'>
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$file'))}
                    )
                    (redir.Redir
                      op: <Redir_Great '>'>
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$file') (.fuzzy))}
                    )
                  ]
                )
                (command.SimpleCommand
                  words: [{(sed)} {(DQ ('/CONTINUATION/ d'))}]
                  redirects: [
                    (redir.Redir
                      op: <Redir_Less '<'>
                      fd: 16777215
                      arg_word: {(DQ ($ VSub_Name '$file') (.fuzzy))}
                    )
                  ]
                )
              ]
            )
          ]
          spids: [91]
        )
      spids: [87 90]
    )
    (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'>
        )
      }
    )
    (command.FuncDef
      name: iconvfromutf8toiso88591
      body: 
        (command.BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {(printf)} {(DQ ('%s'))} {(DQ ($ VSub_Star '$*'))})
                (C {(iconv)} {(-f)} {(UTF-8)} {(-t)} {(ISO8859-1)})
              ]
              negated: F
            )
          ]
          spids: [313]
        )
      spids: [309 312]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:DSCHO spids:[341])
          op: Equal
          rhs: 
            {
              (DQ ('J\xc3\xb6h\xc3\xa4nn\xc3\xabs ') 
                (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ('Dsch\xc3\xb6') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) (' Schind\xc3\xablin')
              )
            }
          spids: [341]
        )
      ]
      spids: [341]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:DSCHOE spids:[350])
          op: Equal
          rhs: {(DQ ($ VSub_Name '$DSCHO') (' <Johannes.Schindelin@gmx.de>'))}
          spids: [350]
        )
      ]
      spids: [350]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:MSG1 spids:[356])
          op: Equal
          rhs: {(DQ ('set a1 to 2 and some non-ASCII chars: \xc3\x84\xc3\x9f\xc3\xb8'))}
          spids: [356]
        )
      ]
      spids: [356]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:MSG2 spids:[361])
          op: Equal
          rhs: {(DQ ('set a1 to 3 and some non-ASCII chars: \xc3\xa1\xc3\xa6\xc3\xaf'))}
          spids: [361]
        )
      ]
      spids: [361]
    )
    (command.SimpleCommand
      words: [{(cat)}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 386
          stdin_parts: [
            ($ VSub_Name '$DSCHO')
            (' (2):\n')
            ('      ')
            ($ VSub_Name '$MSG1')
            ('\n')
            ('      ')
            ($ VSub_Name '$MSG2')
            ('\n')
            ('\n')
          ]
        )
      ]
    )
    (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)})
  ]
)