(command.CommandList
  children: [
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:test_description)
          op: Equal
          rhs: {(SQ <'git rev-list --pretty=format test'>)}
        )
      ]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(.)} {(DQ ($ VSub_DollarName '$TEST_DIRECTORY')) (/lib-terminal.sh)})
    (C {(test_tick)})
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:test_encoding) op:Equal rhs:{(DQ (ISO8859-1))})]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:added_utf8_part)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [(C {(printf)} {(DQ (Lit_Other '\\') (303) (Lit_Other '\\') (274))})]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:added_utf8_part_iso88591)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {(DQ ($ VSub_DollarName '$added_utf8_part'))})
                          (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_DollarName '$test_encoding')})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:added)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (C {(printf)} 
                        {(DQ ('added (hinzugef') (${ VSub_Name added_utf8_part) ('gt) foo'))}
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:added_iso88591)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {(DQ ($ VSub_DollarName '$added'))})
                          (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_DollarName '$test_encoding')})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:changed_utf8_part)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [(C {(printf)} {(DQ (Lit_Other '\\') (303) (Lit_Other '\\') (244))})]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:changed_utf8_part_iso88591)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {(DQ ($ VSub_DollarName '$changed_utf8_part'))})
                          (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_DollarName '$test_encoding')})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:changed)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (C {(printf)} 
                        {(DQ ('changed (ge') (${ VSub_Name changed_utf8_part) ('ndert) foo'))}
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:changed_iso88591)
          op: Equal
          rhs: 
            {
              (word_part.CommandSubPart
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(echo)} {(DQ ($ VSub_DollarName '$changed'))})
                          (C {(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_DollarName '$test_encoding')})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
              )
            }
        )
      ]
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(lhs_expr.LhsName name:truncate_count) op:Equal rhs:{(20)})]
    )
    (C {(test_expect_success)} {(SQ <setup>)} 
      {
        (SQ <'\n'> <'\t: >foo &&\n'> <'\tgit add foo &&\n'> 
          <'\tgit config i18n.commitEncoding $test_encoding &&\n'> <'\techo "$added_iso88591" | git commit -F - &&\n'> <'\thead1=$(git rev-parse --verify HEAD) &&\n'> 
          <'\thead1_short=$(git rev-parse --verify --short $head1) &&\n'> <'\ttree1=$(git rev-parse --verify HEAD:) &&\n'> 
          <'\ttree1_short=$(git rev-parse --verify --short $tree1) &&\n'> <'\techo "$changed" > foo &&\n'> <'\techo "$changed_iso88591" | git commit -a -F - &&\n'> 
          <'\thead2=$(git rev-parse --verify HEAD) &&\n'> <'\thead2_short=$(git rev-parse --verify --short $head2) &&\n'> 
          <'\ttree2=$(git rev-parse --verify HEAD:) &&\n'> <'\ttree2_short=$(git rev-parse --verify --short $tree2) &&\n'> 
          <'\tgit config --unset i18n.commitEncoding\n'>
        )
      }
    )
    (command.FuncDef
      name: test_format
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [{(cat)}]
              redirects: [
                (redir.Redir
                  op: <Redir_Great '>'>
                  fd: 16777215
                  arg_word: {(expect.) ($ VSub_Number '$1')}
                )
              ]
            )
            (C 
              {(test_expect_) 
                (word_part.BracedVarSub
                  token: <VSub_Number 3>
                  suffix_op: (suffix_op.StringUnary op_id:VTest_ColonHyphen arg_word:{(success)})
                )
              } {(DQ ('format ') ($ VSub_Number '$1'))} 
              {
                (DQ ('\n') ("\t\tgit rev-list --pretty=format:'") ($ VSub_Number '$2') 
                  ("' master >output.") ($ VSub_Number '$1') (' &&\n') ('\t\ttest_cmp expect.') ($ VSub_Number '$1') (' output.') 
                  ($ VSub_Number '$1') ('\n') ('\t')
                )
              }
            )
          ]
        )
    )
    (command.Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (lhs_expr.LhsName name:AUTO_COLOR)
          op: Equal
          rhs: {(SQ <'%C(auto,red)foo%C(auto,reset)'>)}
        )
      ]
    )
    (command.FuncDef
      name: has_color
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [{(printf)} {(SQ <'\\033[31mfoo\\033[m\\n'>)}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})]
                )
                (C {(test_cmp)} {(expect)} {(DQ ($ VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.FuncDef
      name: has_no_color
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DAmp]
              children: [
                (command.SimpleCommand
                  words: [{(echo)} {(foo)}]
                  redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect)})]
                )
                (C {(test_cmp)} {(expect)} {(DQ ($ VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.SimpleCommand
      words: [{(test_format)} {(percent)} {(Lit_Other '%') (Lit_Other '%') (h)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 365
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('%h\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('%h\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(hash)} {(Lit_Other '%') (H) (Lit_Other '%') (n) (Lit_Other '%') (h)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 396
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$head2_short')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$head1_short')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(tree)} {(Lit_Other '%') (T) (Lit_Other '%') (n) (Lit_Other '%') (t)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 427
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$tree2')
            ('\n')
            ($ VSub_DollarName '$tree2_short')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$tree1')
            ('\n')
            ($ VSub_DollarName '$tree1_short')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(parents)} {(Lit_Other '%') (P) (Lit_Other '%') (n) (Lit_Other '%') (p)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 456
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$head1_short')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('\n')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(author)}
        {(Lit_Other '%') (an) (Lit_Other '%') (n) (Lit_Other '%') (ae) (Lit_Other '%') (n) (Lit_Other '%') 
          (ad) (Lit_Other '%') (n) (Lit_Other '%') (aD) (Lit_Other '%') (n) (Lit_Other '%') (at)
        }
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 504
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('A U Thor\n')
            ('author@example.com\n')
            ('Thu Apr 7 15:13:13 2005 -0700\n')
            ('Thu, 7 Apr 2005 15:13:13 -0700\n')
            ('1112911993\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('A U Thor\n')
            ('author@example.com\n')
            ('Thu Apr 7 15:13:13 2005 -0700\n')
            ('Thu, 7 Apr 2005 15:13:13 -0700\n')
            ('1112911993\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(committer)}
        {(Lit_Other '%') (cn) (Lit_Other '%') (n) (Lit_Other '%') (ce) (Lit_Other '%') (n) (Lit_Other '%') 
          (cd) (Lit_Other '%') (n) (Lit_Other '%') (cD) (Lit_Other '%') (n) (Lit_Other '%') (ct)
        }
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 549
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('C O Mitter\n')
            ('committer@example.com\n')
            ('Thu Apr 7 15:13:13 2005 -0700\n')
            ('Thu, 7 Apr 2005 15:13:13 -0700\n')
            ('1112911993\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('C O Mitter\n')
            ('committer@example.com\n')
            ('Thu Apr 7 15:13:13 2005 -0700\n')
            ('Thu, 7 Apr 2005 15:13:13 -0700\n')
            ('1112911993\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(encoding)} {(Lit_Other '%') (e)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 572
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$test_encoding')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$test_encoding')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(subject)} {(Lit_Other '%') (s)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 595
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$changed')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$added')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(subject-truncated)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',trunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 627
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('changed (ge')
            (${ VSub_Name changed_utf8_part)
            ('ndert)..\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('added (hinzugef')
            (${ VSub_Name added_utf8_part)
            ('gt..\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(body)} {(Lit_Other '%') (b)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 646
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(raw-body)} {(Lit_Other '%') (B)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 671
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$changed')
            ('\n')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$added')
            ('\n')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(colors)}
        {(Lit_Other '%') (Credfoo) (Lit_Other '%') (Cgreenbar) (Lit_Other '%') (Cbluebaz) (Lit_Other '%') 
          (Cresetxyzzy)
        }
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 698
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('\x1b[31mfoo\x1b[32mbar\x1b[34mbaz\x1b[mxyzzy\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('\x1b[31mfoo\x1b[32mbar\x1b[34mbaz\x1b[mxyzzy\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(advanced-colors)} {(SQ <'%C(red yellow bold)foo%C(reset)'>)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 720
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('\x1b[1;31;43mfoo\x1b[m\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('\x1b[1;31;43mfoo\x1b[m\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'%C(auto,...) does not enable color by default'>)} 
      {(SQ <'\n'> <'\tgit log --format=$AUTO_COLOR -1 >actual &&\n'> <'\thas_no_color actual\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'%C(auto,...) enables colors for color.diff'>)} 
      {
        (SQ <'\n'> <'\tgit -c color.diff=always log --format=$AUTO_COLOR -1 >actual &&\n'> 
          <'\thas_color actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%C(auto,...) enables colors for color.ui'>)} 
      {
        (SQ <'\n'> <'\tgit -c color.ui=always log --format=$AUTO_COLOR -1 >actual &&\n'> 
          <'\thas_color actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%C(auto,...) respects --color'>)} 
      {
        (SQ <'\n'> <'\tgit log --format=$AUTO_COLOR -1 --color >actual &&\n'> <'\thas_color actual\n'>)
      }
    )
    (C {(test_expect_success)} {(SQ <'%C(auto,...) respects --no-color'>)} 
      {
        (SQ <'\n'> <'\tgit -c color.ui=always log --format=$AUTO_COLOR -1 --no-color >actual &&\n'> 
          <'\thas_no_color actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(TTY)} {(SQ <'%C(auto,...) respects --color=auto (stdout is tty)'>)} 
      {
        (SQ <'\n'> <'\ttest_terminal env TERM=vt100 \\\n'> 
          <'\t\tgit log --format=$AUTO_COLOR -1 --color=auto >actual &&\n'> <'\thas_color actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%C(auto,...) respects --color=auto (stdout not tty)'>)} 
      {
        (SQ <'\n'> <'\t(\n'> <'\t\tTERM=vt100 && export TERM &&\n'> 
          <'\t\tgit log --format=$AUTO_COLOR -1 --color=auto >actual &&\n'> <'\t\thas_no_color actual\n'> <'\t)\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%C(auto) respects --color'>)} 
      {
        (SQ <'\n'> <'\tgit log --color --format="%C(auto)%H" -1 >actual &&\n'> 
          <'\tprintf "\\\\033[33m%s\\\\033[m\\\\n" $(git rev-parse HEAD) >expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%C(auto) respects --no-color'>)} 
      {
        (SQ <'\n'> <'\tgit log --no-color --format="%C(auto)%H" -1 >actual &&\n'> 
          <'\tgit rev-parse HEAD >expect &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(iconv)} {(-f)} {(utf-8)} {(-t)} {($ VSub_DollarName '$test_encoding')}]
      redirects: [
        (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(commit-msg)})
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 872
          stdin_parts: [
            ('Test printing of complex bodies\n')
            ('\n')
            ('This commit message is much longer than the others,\n')
            ('and it will be encoded in ')
            ($ VSub_DollarName '$test_encoding')
            ('. We should therefore\n')
            ('include an ISO8859 character: \xc2\xa1bueno!\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'setup complex body'>)} 
      {
        (SQ <'\n'> <'\tgit config i18n.commitencoding $test_encoding &&\n'> 
          <'\techo change2 >foo && git commit -a -F commit-msg &&\n'> <'\thead3=$(git rev-parse --verify HEAD) &&\n'> <'\thead3_short=$(git rev-parse --short $head3)\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(test_format)} {(complex-encoding)} {(Lit_Other '%') (e)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 915
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ($ VSub_DollarName '$test_encoding')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$test_encoding')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$test_encoding')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(complex-subject)} {(Lit_Other '%') (s)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 942
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('Test printing of complex bodies\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$changed_iso88591')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$added_iso88591')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(complex-subject-trunc)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',trunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 978
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('Test printing of c..\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('changed (ge')
            (${ VSub_Name changed_utf8_part_iso88591)
            ('ndert)..\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('added (hinzugef')
            (${ VSub_Name added_utf8_part_iso88591)
            ('gt..\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(complex-subject-mtrunc)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',mtrunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1010
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('Test prin..ex bodies\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('changed (..dert) foo\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('added (hi..f')
            (${ VSub_Name added_utf8_part_iso88591)
            ('gt) foo\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(complex-subject-ltrunc)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',ltrunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1046
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('.. of complex bodies\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('..ged (ge')
            (${ VSub_Name changed_utf8_part_iso88591)
            ('ndert) foo\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('.. (hinzugef')
            (${ VSub_Name added_utf8_part_iso88591)
            ('gt) foo\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'prepare expected messages (for test %b)'>)} 
      {
        (SQ <'\n'> <'\tcat <<-EOF >expected.utf-8 &&\n'> <'\tcommit $head3\n'> 
          <'\tThis commit message is much longer than the others,\n'> <'\tand it will be encoded in $test_encoding. We should therefore\n'> 
          <'\tinclude an ISO8859 character: \xc2\xa1bueno!\n'> <'\n'> <'\tcommit $head2\n'> <'\tcommit $head1\n'> <'\tEOF\n'> 
          <'\ticonv -f utf-8 -t $test_encoding expected.utf-8 >expected.ISO8859-1\n'>
        )
      }
    )
    (command.SimpleCommand
      words: [{(test_format)} {(complex-body)} {(Lit_Other '%') (b)}]
      redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(expected.ISO8859-1)})]
    )
    (C {(git)} {(config)} {(--unset)} {(i18n.commitEncoding)})
    (command.SimpleCommand
      words: [{(test_format)} {(complex-subject-commitencoding-unset)} {(Lit_Other '%') (s)}]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1120
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('Test printing of complex bodies\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ($ VSub_DollarName '$changed')
            ('\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ($ VSub_DollarName '$added')
            ('\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(complex-subject-commitencoding-unset-trunc)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',trunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1156
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('Test printing of c..\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('changed (ge')
            (${ VSub_Name changed_utf8_part)
            ('ndert)..\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('added (hinzugef')
            (${ VSub_Name added_utf8_part)
            ('gt..\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(complex-subject-commitencoding-unset-mtrunc)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',mtrunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1188
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('Test prin..ex bodies\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('changed (..dert) foo\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('added (hi..f')
            (${ VSub_Name added_utf8_part)
            ('gt) foo\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [
        {(test_format)}
        {(complex-subject-commitencoding-unset-ltrunc)}
        {(DQ ('%<(') ($ VSub_DollarName '$truncate_count') (',ltrunc)%s'))}
      ]
      redirects: [
        (redir.HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EOF)}
          here_end_span_id: 1224
          stdin_parts: [
            ('commit ')
            ($ VSub_DollarName '$head3')
            ('\n')
            ('.. of complex bodies\n')
            ('commit ')
            ($ VSub_DollarName '$head2')
            ('\n')
            ('..ged (ge')
            (${ VSub_Name changed_utf8_part)
            ('ndert) foo\n')
            ('commit ')
            ($ VSub_DollarName '$head1')
            ('\n')
            ('.. (hinzugef')
            (${ VSub_Name added_utf8_part)
            ('gt) foo\n')
          ]
        )
      ]
    )
    (command.SimpleCommand
      words: [{(test_format)} {(complex-body-commitencoding-unset)} {(Lit_Other '%') (b)}]
      redirects: [(redir.Redir op:<Redir_Less '<'> fd:16777215 arg_word:{(expected.utf-8)})]
    )
    (C {(test_expect_success)} {(SQ <'%x00 shows NUL'>)} 
      {
        (SQ <'\n'> <'\techo  >expect commit $head3 &&\n'> <'\techo >>expect fooQbar &&\n'> 
          <'\tgit rev-list -1 --format=foo%x00bar HEAD >actual.nul &&\n'> <'\tnul_to_q <actual.nul >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%ad respects --date='>)} 
      {
        (SQ <'\n'> <'\techo 2005-04-07 >expect.ad-short &&\n'> 
          <'\tgit log -1 --date=short --pretty=tformat:%ad >output.ad-short master &&\n'> <'\ttest_cmp expect.ad-short output.ad-short\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'empty email'>)} 
      {
        (SQ <'\n'> <'\ttest_tick &&\n'> 
          <'\tC=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&\n'> <'\tA=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&\n'> 
          <'\tverbose test "$A" = "A U Thor,,Thu Apr 7 15:14:13 2005 -0700"\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'del LF before empty (1)'>)} 
      {
        (SQ <'\n'> <'\tgit show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual &&\n'> 
          <'\ttest_line_count = 2 actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'del LF before empty (2)'>)} 
      {
        (SQ <'\n'> <'\tgit show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD >actual &&\n'> 
          <'\ttest_line_count = 6 actual &&\n'> <'\tgrep "^$" actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'add LF before non-empty (1)'>)} 
      {
        (SQ <'\n'> <'\tgit show -s --pretty=format:"%s%+b%nThanks%n" HEAD^^ >actual &&\n'> 
          <'\ttest_line_count = 2 actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'add LF before non-empty (2)'>)} 
      {
        (SQ <'\n'> <'\tgit show -s --pretty=format:"%s%+b%nThanks%n" HEAD >actual &&\n'> 
          <'\ttest_line_count = 6 actual &&\n'> <'\tgrep "^$" actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'add SP before non-empty (1)'>)} 
      {
        (SQ <'\n'> <'\tgit show -s --pretty=format:"%s% bThanks" HEAD^^ >actual &&\n'> 
          <'\ttest $(wc -w <actual) = 3\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'add SP before non-empty (2)'>)} 
      {
        (SQ <'\n'> <'\tgit show -s --pretty=format:"%s% sThanks" HEAD^^ >actual &&\n'> 
          <'\ttest $(wc -w <actual) = 6\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <--abbrev>)} 
      {
        (SQ <'\n'> <'\techo SHORT SHORT SHORT >expect2 &&\n'> <'\techo LONG LONG LONG >expect3 &&\n'> 
          <'\tgit log -1 --format="%h %h %h" HEAD >actual1 &&\n'> <'\tgit log -1 --abbrev=5 --format="%h %h %h" HEAD >actual2 &&\n'> 
          <'\tgit log -1 --abbrev=5 --format="%H %H %H" HEAD >actual3 &&\n'> <'\tsed -e "s/$_x40/LONG/g" -e "s/$_x05/SHORT/g" <actual2 >fuzzy2 &&\n'> 
          <'\tsed -e "s/$_x40/LONG/g" -e "s/$_x05/SHORT/g" <actual3 >fuzzy3 &&\n'> <'\ttest_cmp expect2 fuzzy2 &&\n'> <'\ttest_cmp expect3 fuzzy3 &&\n'> 
          <'\t! test_cmp actual1 actual2\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%H is not affected by --abbrev-commit'>)} 
      {
        (SQ <'\n'> <'\tgit log -1 --format=%H --abbrev-commit --abbrev=20 HEAD >actual &&\n'> 
          <'\tlen=$(wc -c <actual) &&\n'> <'\ttest $len = 41\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%h is not affected by --abbrev-commit'>)} 
      {
        (SQ <'\n'> <'\tgit log -1 --format=%h --abbrev-commit --abbrev=20 HEAD >actual &&\n'> 
          <'\tlen=$(wc -c <actual) &&\n'> <'\ttest $len = 21\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'"%h %gD: %gs" is same as git-reflog'>)} 
      {
        (SQ <'\n'> <'\tgit reflog >expect &&\n'> <'\tgit log -g --format="%h %gD: %gs" >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'"%h %gD: %gs" is same as git-reflog (with date)'>)} 
      {
        (SQ <'\n'> <'\tgit reflog --date=raw >expect &&\n'> 
          <'\tgit log -g --format="%h %gD: %gs" --date=raw >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'"%h %gD: %gs" is same as git-reflog (with --abbrev)'>)} 
      {
        (SQ <'\n'> <'\tgit reflog --abbrev=13 --date=raw >expect &&\n'> 
          <'\tgit log -g --abbrev=13 --format="%h %gD: %gs" --date=raw >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'%gd shortens ref name'>)} 
      {
        (SQ <'\n'> <'\techo "master@{0}" >expect.gd-short &&\n'> 
          <'\tgit log -g -1 --format=%gd refs/heads/master >actual.gd-short &&\n'> <'\ttest_cmp expect.gd-short actual.gd-short\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'reflog identity'>)} 
      {
        (SQ <'\n'> <'\techo "C O Mitter:committer@example.com" >expect &&\n'> 
          <'\tgit log -g -1 --format="%gn:%ge" >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'oneline with empty message'>)} 
      {
        (SQ <'\n'> <'\tgit commit -m "dummy" --allow-empty &&\n'> 
          <'\tgit commit -m "dummy" --allow-empty &&\n'> <'\tgit filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&\n'> 
          <'\tgit rev-list --oneline HEAD >test.txt &&\n'> <'\ttest_line_count = 5 test.txt &&\n'> <'\tgit rev-list --oneline --graph HEAD >testg.txt &&\n'> 
          <'\ttest_line_count = 5 testg.txt\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'single-character name is parsed correctly'>)} 
      {
        (SQ <'\n'> <'\tgit commit --author="a <a@example.com>" --allow-empty -m foo &&\n'> 
          <'\techo "a <a@example.com>" >expect &&\n'> <'\tgit log -1 --format="%an <%ae>" >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'unused %G placeholders are passed through'>)} 
      {
        (SQ <'\n'> <'\techo "%GX %G" >expect &&\n'> <'\tgit log -1 --format="%GX %G" >actual &&\n'> 
          <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)