(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description spids:[13])
          op: Equal
          rhs: {(SQ <'Various diff formatting options'>)}
          spids: [13]
        )
      ]
      spids: [13]
    )
    (C {(.)} {(./test-lib.sh)})
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:LF spids:[24]) op:Equal rhs:{(SQ <'\n'>)} spids:[24])]
      spids: [24]
    )
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <'\n'> <'\n'> <'\tGIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&\n'> 
          <'\tGIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&\n'> <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\n'> <'\tmkdir dir &&\n'> <'\tmkdir dir2 &&\n'> 
          <'\tfor i in 1 2 3; do echo $i; done >file0 &&\n'> <'\tfor i in A B; do echo $i; done >dir/sub &&\n'> <'\tcat file0 >file2 &&\n'> 
          <'\tgit add file0 file2 dir/sub &&\n'> <'\tgit commit -m Initial &&\n'> <'\n'> <'\tgit branch initial &&\n'> <'\tgit branch side &&\n'> <'\n'> 
          <'\tGIT_AUTHOR_DATE="2006-06-26 00:01:00 +0000" &&\n'> <'\tGIT_COMMITTER_DATE="2006-06-26 00:01:00 +0000" &&\n'> 
          <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\n'> <'\tfor i in 4 5 6; do echo $i; done >>file0 &&\n'> 
          <'\tfor i in C D; do echo $i; done >>dir/sub &&\n'> <'\trm -f file2 &&\n'> <'\tgit update-index --remove file0 file2 dir/sub &&\n'> 
          <'\tgit commit -m "Second${LF}${LF}This is the second commit." &&\n'> <'\n'> <'\tGIT_AUTHOR_DATE="2006-06-26 00:02:00 +0000" &&\n'> 
          <'\tGIT_COMMITTER_DATE="2006-06-26 00:02:00 +0000" &&\n'> <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\n'> 
          <'\tfor i in A B C; do echo $i; done >file1 &&\n'> <'\tgit add file1 &&\n'> <'\tfor i in E F; do echo $i; done >>dir/sub &&\n'> 
          <'\tgit update-index dir/sub &&\n'> <'\tgit commit -m Third &&\n'> <'\n'> <'\tGIT_AUTHOR_DATE="2006-06-26 00:03:00 +0000" &&\n'> 
          <'\tGIT_COMMITTER_DATE="2006-06-26 00:03:00 +0000" &&\n'> <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\n'> <'\tgit checkout side &&\n'> 
          <'\tfor i in A B C; do echo $i; done >>file0 &&\n'> <'\tfor i in 1 2; do echo $i; done >>dir/sub &&\n'> <'\tcat dir/sub >file3 &&\n'> 
          <'\tgit add file3 &&\n'> <'\tgit update-index file0 dir/sub &&\n'> <'\tgit commit -m Side &&\n'> <'\n'> 
          <'\tGIT_AUTHOR_DATE="2006-06-26 00:04:00 +0000" &&\n'> <'\tGIT_COMMITTER_DATE="2006-06-26 00:04:00 +0000" &&\n'> 
          <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\n'> <'\tgit checkout master &&\n'> <'\tgit pull -s ours . side &&\n'> <'\n'> 
          <'\tGIT_AUTHOR_DATE="2006-06-26 00:05:00 +0000" &&\n'> <'\tGIT_COMMITTER_DATE="2006-06-26 00:05:00 +0000" &&\n'> 
          <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\n'> <'\tfor i in A B C; do echo $i; done >>file0 &&\n'> 
          <'\tfor i in 1 2; do echo $i; done >>dir/sub &&\n'> <'\tgit update-index file0 dir/sub &&\n'> <'\n'> <'\tmkdir dir3 &&\n'> <'\tcp dir/sub dir3/sub &&\n'> 
          <'\ttest-chmtime +1 dir3/sub &&\n'> <'\n'> <'\tgit config log.showroot false &&\n'> <'\tgit commit --amend &&\n'> <'\n'> 
          <'\tGIT_AUTHOR_DATE="2006-06-26 00:06:00 +0000" &&\n'> <'\tGIT_COMMITTER_DATE="2006-06-26 00:06:00 +0000" &&\n'> 
          <'\texport GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&\n'> <'\tgit checkout -b rearrange initial &&\n'> <'\tfor i in B A; do echo $i; done >dir/sub &&\n'> 
          <'\tgit add dir/sub &&\n'> <'\tgit commit -m "Rearranged lines in dir/sub" &&\n'> <'\tgit checkout master &&\n'> <'\n'> 
          <'\tgit config diff.renames false &&\n'> <'\n'> <'\tgit show-branch\n'>
        )
      }
    )
    (SimpleCommand
      words: [{(Lit_Other ':')}]
      redirects: [
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 138
          stdin_parts: [
            ('! [initial] Initial\n')
            (" * [master] Merge branch 'side'\n")
            ('  ! [rearrange] Rearranged lines in dir/sub\n')
            ('   ! [side] Side\n')
            ('----\n')
            ('  +  [rearrange] Rearranged lines in dir/sub\n')
            (" -   [master] Merge branch 'side'\n")
            (' * + [side] Side\n')
            (' *   [master^] Third\n')
            (' *   [master~2] Second\n')
            ('+*++ [initial] Initial\n')
          ]
        )
      ]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:V spids:[140])
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [
                          (C {(git)} {(version)})
                          (C {(sed)} {(-e)} {(SQ <'s/^git version //'>)} {(-e)} {(SQ <'s/\\./\\\\./g'>)})
                        ]
                        negated: F
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [141 161]
              )
            }
          spids: [140]
        )
      ]
      spids: [140]
    )
    (WhileUntil
      keyword: <KW_While while>
      cond: [(C {(read)} {(cmd)})]
      body: 
        (DoGroup
          children: [
            (Case
              to_match: {(DQ ($ VSub_Name '$cmd'))}
              arms: [
                (case_arm
                  pat_list: [{(SQ )} {(SQ <'#'>) (Lit_Other '*')}]
                  action: [(ControlFlow token:<ControlFlow_Continue continue>)]
                  spids: [181 190 194 16777215]
                )
              ]
              spids: [172 178 197]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:test spids:[200])
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(echo)} {(DQ ($ VSub_Name '$cmd'))})
                                  (C {(sed)} {(-e)} {(SQ <'s|[/ ][/ ]*|_|g'>)})
                                ]
                                negated: F
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [201 217]
                      )
                    }
                  spids: [200]
                )
              ]
              spids: [200]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:pfx spids:[220])
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(printf)} {(DQ ('%04d'))} {($ VSub_Name '$test_count')})]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [221 229]
                      )
                    }
                  spids: [220]
                )
              ]
              spids: [220]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:expect spids:[232])
                  op: Equal
                  rhs: {(DQ ($ VSub_Name '$TEST_DIRECTORY') (/t4013/diff.) ($ VSub_Name '$test'))}
                  spids: [232]
                )
              ]
              spids: [232]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:actual spids:[240])
                  op: Equal
                  rhs: {(DQ ($ VSub_Name '$pfx') (-diff.) ($ VSub_Name '$test'))}
                  spids: [240]
                )
              ]
              spids: [240]
            )
            (C {(test_expect_success)} {(DQ ('git ') ($ VSub_Name '$cmd'))} 
              {
                (SQ <'\n'> <'\t\t{\n'> <'\t\t\techo "\\$ git $cmd"\n'> <'\t\t\tgit $cmd |\n'> 
                  <
'\t\t\tsed -e "s/^\\\\(-*\\\\)$V\\\\(-*\\\\)\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2/" \\\n'
                  > 
                  <
'\t\t\t    -e "s/^\\\\(.*mixed; boundary=\\"-*\\\\)$V\\\\(-*\\\\)\\"\\$/\\\\1g-i-t--v-e-r-s-i-o-n\\2\\"/"\n'
                  > <'\t\t\techo "\\$"\n'> <'\t\t} >"$actual" &&\n'> <'\t\tif test -f "$expect"\n'> <'\t\tthen\n'> 
                  <'\t\t\tcase $cmd in\n'> <'\t\t\t*format-patch* | *-stat*)\n'> <'\t\t\t\ttest_i18ncmp "$expect" "$actual";;\n'> <'\t\t\t*)\n'> 
                  <'\t\t\t\ttest_cmp "$expect" "$actual";;\n'> <'\t\t\tesac &&\n'> <'\t\t\trm -f "$actual"\n'> <'\t\telse\n'> 
                  <'\t\t\t# this is to help developing new tests.\n'> <'\t\t\tcp "$actual" "$expect"\n'> <'\t\t\tfalse\n'> <'\t\tfi\n'> <'\t'>
                )
              }
            )
          ]
          spids: [169 282]
        )
      redirects: [
        (HereDoc
          op: <Redir_DLess '<<'>
          fd: 16777215
          here_begin: {(EscapedLiteralPart token:<Lit_EscapedChar '\\E'>) (OF)}
          here_end_span_id: 455
          stdin_parts: [
            ('diff-tree initial\n')
            ('diff-tree -r initial\n')
            ('diff-tree -r --abbrev initial\n')
            ('diff-tree -r --abbrev=4 initial\n')
            ('diff-tree --root initial\n')
            ('diff-tree --root --abbrev initial\n')
            ('diff-tree --root -r initial\n')
            ('diff-tree --root -r --abbrev initial\n')
            ('diff-tree --root -r --abbrev=4 initial\n')
            ('diff-tree -p initial\n')
            ('diff-tree --root -p initial\n')
            ('diff-tree --patch-with-stat initial\n')
            ('diff-tree --root --patch-with-stat initial\n')
            ('diff-tree --patch-with-raw initial\n')
            ('diff-tree --root --patch-with-raw initial\n')
            ('\n')
            ('diff-tree --pretty initial\n')
            ('diff-tree --pretty --root initial\n')
            ('diff-tree --pretty -p initial\n')
            ('diff-tree --pretty --stat initial\n')
            ('diff-tree --pretty --summary initial\n')
            ('diff-tree --pretty --stat --summary initial\n')
            ('diff-tree --pretty --root -p initial\n')
            ('diff-tree --pretty --root --stat initial\n')
            ("# improved by Timo's patch\n")
            ('diff-tree --pretty --root --summary initial\n')
            ("# improved by Timo's patch\n")
            ('diff-tree --pretty --root --summary -r initial\n')
            ('diff-tree --pretty --root --stat --summary initial\n')
            ('diff-tree --pretty --patch-with-stat initial\n')
            ('diff-tree --pretty --root --patch-with-stat initial\n')
            ('diff-tree --pretty --patch-with-raw initial\n')
            ('diff-tree --pretty --root --patch-with-raw initial\n')
            ('\n')
            ('diff-tree --pretty=oneline initial\n')
            ('diff-tree --pretty=oneline --root initial\n')
            ('diff-tree --pretty=oneline -p initial\n')
            ('diff-tree --pretty=oneline --root -p initial\n')
            ('diff-tree --pretty=oneline --patch-with-stat initial\n')
            ("# improved by Timo's patch\n")
            ('diff-tree --pretty=oneline --root --patch-with-stat initial\n')
            ('diff-tree --pretty=oneline --patch-with-raw initial\n')
            ('diff-tree --pretty=oneline --root --patch-with-raw initial\n')
            ('\n')
            ('diff-tree --pretty side\n')
            ('diff-tree --pretty -p side\n')
            ('diff-tree --pretty --patch-with-stat side\n')
            ('\n')
            ('diff-tree master\n')
            ('diff-tree -p master\n')
            ('diff-tree -p -m master\n')
            ('diff-tree -c master\n')
            ('diff-tree -c --abbrev master\n')
            ('diff-tree --cc master\n')
            ('# stat only should show the diffstat with the first parent\n')
            ('diff-tree -c --stat master\n')
            ('diff-tree --cc --stat master\n')
            ('diff-tree -c --stat --summary master\n')
            ('diff-tree --cc --stat --summary master\n')
            ('# stat summary should show the diffstat and summary with the first parent\n')
            ('diff-tree -c --stat --summary side\n')
            ('diff-tree --cc --stat --summary side\n')
            ("# improved by Timo's patch\n")
            ('diff-tree --cc --patch-with-stat master\n')
            ("# improved by Timo's patch\n")
            ('diff-tree --cc --patch-with-stat --summary master\n')
            ('# this is correct\n')
            ('diff-tree --cc --patch-with-stat --summary side\n')
            ('\n')
            ('log master\n')
            ('log -p master\n')
            ('log --root master\n')
            ('log --root -p master\n')
            ('log --patch-with-stat master\n')
            ('log --root --patch-with-stat master\n')
            ('log --root --patch-with-stat --summary master\n')
            ("# improved by Timo's patch\n")
            ('log --root -c --patch-with-stat --summary master\n')
            ("# improved by Timo's patch\n")
            ('log --root --cc --patch-with-stat --summary master\n')
            ('log -p --first-parent master\n')
            ('log -m -p --first-parent master\n')
            ('log -m -p master\n')
            ('log -SF master\n')
            ('log -S F master\n')
            ('log -SF -p master\n')
            ('log -SF master --max-count=0\n')
            ('log -SF master --max-count=1\n')
            ('log -SF master --max-count=2\n')
            ('log -GF master\n')
            ('log -GF -p master\n')
            ('log -GF -p --pickaxe-all master\n')
            ('log --decorate --all\n')
            ('log --decorate=full --all\n')
            ('\n')
            ('rev-list --parents HEAD\n')
            ('rev-list --children HEAD\n')
            ('\n')
            ('whatchanged master\n')
            ('whatchanged -p master\n')
            ('whatchanged --root master\n')
            ('whatchanged --root -p master\n')
            ('whatchanged --patch-with-stat master\n')
            ('whatchanged --root --patch-with-stat master\n')
            ('whatchanged --root --patch-with-stat --summary master\n')
            ("# improved by Timo's patch\n")
            ('whatchanged --root -c --patch-with-stat --summary master\n')
            ("# improved by Timo's patch\n")
            ('whatchanged --root --cc --patch-with-stat --summary master\n')
            ('whatchanged -SF master\n')
            ('whatchanged -SF -p master\n')
            ('\n')
            ('log --patch-with-stat master -- dir/\n')
            ('whatchanged --patch-with-stat master -- dir/\n')
            ('log --patch-with-stat --summary master -- dir/\n')
            ('whatchanged --patch-with-stat --summary master -- dir/\n')
            ('\n')
            ('show initial\n')
            ('show --root initial\n')
            ('show side\n')
            ('show master\n')
            ('show -c master\n')
            ('show -m master\n')
            ('show --first-parent master\n')
            ('show --stat side\n')
            ('show --stat --summary side\n')
            ('show --patch-with-stat side\n')
            ('show --patch-with-raw side\n')
            ('show --patch-with-stat --summary side\n')
            ('\n')
            ('format-patch --stdout initial..side\n')
            ('format-patch --stdout initial..master^\n')
            ('format-patch --stdout initial..master\n')
            ('format-patch --stdout --no-numbered initial..master\n')
            ('format-patch --stdout --numbered initial..master\n')
            ('format-patch --attach --stdout initial..side\n')
            ('format-patch --attach --stdout --suffix=.diff initial..side\n')
            ('format-patch --attach --stdout initial..master^\n')
            ('format-patch --attach --stdout initial..master\n')
            ('format-patch --inline --stdout initial..side\n')
            ('format-patch --inline --stdout initial..master^\n')
            ('format-patch --inline --stdout --numbered-files initial..master\n')
            ('format-patch --inline --stdout initial..master\n')
            ('format-patch --inline --stdout --subject-prefix=TESTCASE initial..master\n')
            ('config format.subjectprefix DIFFERENT_PREFIX\n')
            ('format-patch --inline --stdout initial..master^^\n')
            ('format-patch --stdout --cover-letter -n initial..master^\n')
            ('\n')
            ('diff --abbrev initial..side\n')
            ('diff -r initial..side\n')
            ('diff --stat initial..side\n')
            ('diff -r --stat initial..side\n')
            ('diff initial..side\n')
            ('diff --patch-with-stat initial..side\n')
            ('diff --patch-with-raw initial..side\n')
            ('diff --patch-with-stat -r initial..side\n')
            ('diff --patch-with-raw -r initial..side\n')
            ('diff --name-status dir2 dir\n')
            ('diff --no-index --name-status dir2 dir\n')
            ('diff --no-index --name-status -- dir2 dir\n')
            ('diff --no-index dir dir3\n')
            ('diff master master^ side\n')
            ("# Can't use spaces...\n")
            ('diff --line-prefix=abc master master^ side\n')
            ('diff --dirstat master~1 master~2\n')
            ('diff --dirstat initial rearrange\n')
            ('diff --dirstat-by-file initial rearrange\n')
          ]
        )
      ]
    )
    (C {(test_expect_success)} {(SQ <'log -S requires an argument'>)} 
      {(SQ <'\n'> <'\ttest_must_fail git log -S\n'>)}
    )
    (C {(test_expect_success)} {(SQ <'diff --cached on unborn branch'>)} 
      {
        (SQ <'\n'> <'\techo ref: refs/heads/unborn >.git/HEAD &&\n'> 
          <'\tgit diff --cached >result &&\n'> <'\ttest_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached" result\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff --cached -- file on unborn branch'>)} 
      {
        (SQ <'\n'> <'\tgit diff --cached -- file0 >result &&\n'> 
          <'\ttest_cmp "$TEST_DIRECTORY/t4013/diff.diff_--cached_--_file0" result\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff --line-prefix with spaces'>)} 
      {
        (SQ <'\n'> <'\tgit diff --line-prefix="| | | " --cached -- file0 >result &&\n'> 
          <'\ttest_cmp "$TEST_DIRECTORY/t4013/diff.diff_--line-prefix_--cached_--_file0" result\n'>
        )
      }
    )
    (C {(test_expect_success)} {(SQ <'diff-tree --stdin with log formatting'>)} 
      {
        (SQ <'\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\tSide\n'> <'\tThird\n'> <'\tSecond\n'> <'\tEOF\n'> 
          <'\tgit rev-list master | git diff-tree --stdin --format=%s -s >actual &&\n'> <'\ttest_cmp expect actual\n'>
        )
      }
    )
    (C {(test_done)})
  ]
)