(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: 
            {
              (SQ <"Support for verbose submodule differences in git diff\n"> <"\n"> 
                <"This test tries to verify the sanity of the --submodule option of git diff.\n">
              )
            }
          spids: [16]
        )
      ]
      spids: [16]
    )
    (C {(.)} {(./test-lib.sh)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_encoding)
          op: Equal
          rhs: {(DQ (ISO8859-1))}
          spids: [32]
        )
      ]
      spids: [32]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:added)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (C {(printf)} 
                        {
                          (DQ (hinzugef) (EscapedLiteralPart token:<Lit_EscapedChar "\\3">) (03) 
                            (EscapedLiteralPart
                              token: <Lit_EscapedChar "\\2">
                            ) (74gt)
                          )
                        }
                      )
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [45 55]
              )
            }
          spids: [44]
        )
      ]
      spids: [44]
    )
    (FuncDef
      name: add_file
      body: 
        (BraceGroup
          children: [
            (Subshell
              child: 
                (AndOr
                  children: [
                    (C {(cd)} {(DQ ($ VSub_Number "$1"))})
                    (AndOr
                      children: [
                        (C {(shift)})
                        (AndOr
                          children: [
                            (ForEach
                              iter_name: name
                              do_arg_iter: True
                              body: 
                                (DoGroup
                                  children: [
                                    (AndOr
                                      children: [
                                        (SimpleCommand
                                          words: [{(echo)} {(DQ ($ VSub_Name "$name"))}]
                                          redirects: [
                                            (Redir
                                              op_id: Redir_Great
                                              fd: -1
                                              arg_word: {(DQ ($ VSub_Name "$name"))}
                                              spids: [96]
                                            )
                                          ]
                                        )
                                        (AndOr
                                          children: [
                                            (C {(git)} {(add)} {(DQ ($ VSub_Name "$name"))})
                                            (AndOr
                                              children: [
                                                (C {(test_tick)})
                                                (Pipeline
                                                  children: [
                                                    (C {(echo)} 
                                                      {
                                                        (DQ ("Add ") ($ VSub_Name "$name") (" (") 
                                                          ($ VSub_Name "$added") (" ") ($ VSub_Name "$name") (")")
                                                        )
                                                      }
                                                    )
                                                    (C {(iconv)} {(-f)} {(utf-8)} {(-t)} 
                                                      {($ VSub_Name "$test_encoding")}
                                                    )
                                                    (C {(git)} {(-c)} 
                                                      {
                                                        (DQ ("i18n.commitEncoding=") 
                                                          ($ VSub_Name "$test_encoding")
                                                        )
                                                      } {(commit)} {(-F)} {(-)}
                                                    )
                                                  ]
                                                  negated: False
                                                )
                                              ]
                                              op_id: Op_DAmp
                                            )
                                          ]
                                          op_id: Op_DAmp
                                        )
                                      ]
                                      op_id: Op_DAmp
                                    )
                                  ]
                                  spids: [87 171]
                                )
                              redirects: [
                                (Redir
                                  op_id: Redir_Great
                                  fd: -1
                                  arg_word: {(/dev/null)}
                                  spids: [173]
                                )
                              ]
                              spids: [-1 -1]
                            )
                            (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)})
                          ]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              spids: [65 190]
            )
          ]
          spids: [62]
        )
      spids: [57 61]
    )
    (FuncDef
      name: commit_file
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(test_tick)})
                (SimpleCommand
                  words: [
                    {(git)}
                    {(commit)}
                    {(DQ ($ VSub_At "$@"))}
                    {(-m)}
                    {(DQ ("Commit ") ($ VSub_Star "$*"))}
                  ]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[222])]
                )
              ]
              op_id: Op_DAmp
            )
          ]
          spids: [199]
        )
      spids: [194 198]
    )
    (AndOr
      children: [
        (C {(test_create_repo)} {(sm1)})
        (SimpleCommand
          words: [{(add_file)} {(.)} {(foo)}]
          redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[240])]
        )
      ]
      op_id: Op_DAmp
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:head1)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(add_file)} {(sm1)} {(foo1)} {(foo2)})])
                left_token: <Left_CommandSub "$(">
                spids: [245 253]
              )
            }
          spids: [244]
        )
      ]
      spids: [244]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:fullhead1)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Sentence
                        child: (C {(cd)} {(sm1)})
                        terminator: <Op_Semi ";">
                      )
                      (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)})
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [256 269]
              )
            }
          spids: [255]
        )
      ]
      spids: [255]
    )
    (C {(test_expect_success)} {(SQ <"added submodule">)} 
      {
        (SQ <"\n"> <"\tgit add sm1 &&\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 0000000...$head1 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"added submodule, set diff.submodule">)} 
      {
        (SQ <"\n"> <"\tgit config diff.submodule log &&\n"> <"\tgit add sm1 &&\n"> 
          <"\tgit diff --cached >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 0000000...$head1 (new submodule)\n"> <"\tEOF\n"> 
          <"\tgit config --unset diff.submodule &&\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"--submodule=short overrides diff.submodule">)} 
      {
        (SQ <"\n"> <"\ttest_config diff.submodule log &&\n"> <"\tgit add sm1 &&\n"> 
          <"\tgit diff --submodule=short --cached >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tdiff --git a/sm1 b/sm1\n"> <"\tnew file mode 160000\n"> 
          <"\tindex 0000000..$head1\n"> <"\t--- /dev/null\n"> <"\t+++ b/sm1\n"> <"\t@@ -0,0 +1 @@\n"> <"\t+Subproject commit $fullhead1\n"> 
          <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff.submodule does not affect plumbing">)} 
      {
        (SQ <"\n"> <"\ttest_config diff.submodule log &&\n"> <"\tgit diff-index -p HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tdiff --git a/sm1 b/sm1\n"> <"\tnew file mode 160000\n"> <"\tindex 0000000..$head1\n"> 
          <"\t--- /dev/null\n"> <"\t+++ b/sm1\n"> <"\t@@ -0,0 +1 @@\n"> <"\t+Subproject commit $fullhead1\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (C {(commit_file)} {(sm1)})
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:head2)
              op: Equal
              rhs: 
                {
                  (CommandSubPart
                    command_list: (CommandList children:[(C {(add_file)} {(sm1)} {(foo3)})])
                    left_token: <Left_CommandSub "$(">
                    spids: [362 368]
                  )
                }
              spids: [361]
            )
          ]
          spids: [361]
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"modified submodule(forward)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head1..$head2:\n"> <"\t  > Add foo3 ($added foo3)\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"modified submodule(forward)">)} 
      {
        (SQ <"\n"> <"\tgit diff --submodule=log >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> 
          <"\tSubmodule sm1 $head1..$head2:\n"> <"\t  > Add foo3 ($added foo3)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"modified submodule(forward) --submodule">)} 
      {
        (SQ <"\n"> <"\tgit diff --submodule >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> 
          <"\tSubmodule sm1 $head1..$head2:\n"> <"\t  > Add foo3 ($added foo3)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:fullhead2)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Sentence
                        child: (C {(cd)} {(sm1)})
                        terminator: <Op_Semi ";">
                      )
                      (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)})
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [423 436]
              )
            }
          spids: [422]
        )
      ]
      spids: [422]
    )
    (C {(test_expect_success)} {(SQ <"modified submodule(forward) --submodule=short">)} 
      {
        (SQ <"\n"> <"\tgit diff --submodule=short >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> 
          <"\tdiff --git a/sm1 b/sm1\n"> <"\tindex $head1..$head2 160000\n"> <"\t--- a/sm1\n"> <"\t+++ b/sm1\n"> <"\t@@ -1 +1 @@\n"> 
          <"\t-Subproject commit $fullhead1\n"> <"\t+Subproject commit $fullhead2\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (C {(commit_file)} {(sm1)})
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:head3)
              op: Equal
              rhs: 
                {
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [
                          (AndOr
                            children: [
                              (C {(cd)} {(sm1)})
                              (AndOr
                                children: [
                                  (SimpleCommand
                                    words: [{(git)} {(reset)} {(--hard)} {(HEAD) (Lit_Tilde "~") (2)}]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_Great
                                        fd: -1
                                        arg_word: {(/dev/null)}
                                        spids: [487]
                                      )
                                    ]
                                  )
                                  (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)})
                                ]
                                op_id: Op_DAmp
                              )
                            ]
                            op_id: Op_DAmp
                          )
                        ]
                      )
                    left_token: <Left_CommandSub "$(">
                    spids: [467 503]
                  )
                }
              spids: [466]
            )
          ]
          spids: [466]
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"modified submodule(backward)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head2..$head3 (rewind):\n"> <"\t  < Add foo3 ($added foo3)\n"> 
          <"\t  < Add foo2 ($added foo2)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:head4)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: (CommandList children:[(C {(add_file)} {(sm1)} {(foo4)} {(foo5)})])
                left_token: <Left_CommandSub "$(">
                spids: [525 533]
              )
            }
          spids: [524]
        )
      ]
      spids: [524]
    )
    (C {(test_expect_success)} {(SQ <"modified submodule(backward and forward)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head2...$head4:\n"> <"\t  > Add foo5 ($added foo5)\n"> 
          <"\t  > Add foo4 ($added foo4)\n"> <"\t  < Add foo3 ($added foo3)\n"> <"\t  < Add foo2 ($added foo2)\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (C {(commit_file)} {(sm1)})
        (AndOr
          children: [
            (C {(mv)} {(sm1)} {(sm1-bak)})
            (AndOr
              children: [
                (SimpleCommand
                  words: [{(echo)} {(sm1)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(sm1)} spids:[573])]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:head5)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (Pipeline
                                        children: [
                                          (C {(git)} {(hash-object)} {(sm1)})
                                          (C {(cut)} {(-c1-7)})
                                        ]
                                        negated: False
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub "$(">
                                spids: [579 591]
                              )
                            }
                          spids: [578]
                        )
                      ]
                      spids: [578]
                    )
                    (AndOr
                      children: [
                        (C {(git)} {(add)} {(sm1)})
                        (AndOr
                          children: [(C {(rm)} {(-f)} {(sm1)}) (C {(mv)} {(sm1-bak)} {(sm1)})]
                          op_id: Op_DAmp
                        )
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  op_id: Op_DAmp
                )
              ]
              op_id: Op_DAmp
            )
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"typechanged submodule(submodule->blob), --cached">)} 
      {
        (SQ <"\n"> <"\tgit diff --submodule=log --cached >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> 
          <"\tSubmodule sm1 $head4...0000000 (submodule deleted)\n"> <"\tdiff --git a/sm1 b/sm1\n"> <"\tnew file mode 100644\n"> <"\tindex 0000000..$head5\n"> 
          <"\t--- /dev/null\n"> <"\t+++ b/sm1\n"> <"\t@@ -0,0 +1 @@\n"> <"\t+sm1\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"typechanged submodule(submodule->blob)">)} 
      {
        (SQ <"\n"> <"\tgit diff --submodule=log >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> 
          <"\tdiff --git a/sm1 b/sm1\n"> <"\tdeleted file mode 100644\n"> <"\tindex $head5..0000000\n"> <"\t--- a/sm1\n"> <"\t+++ /dev/null\n"> 
          <"\t@@ -1 +0,0 @@\n"> <"\t-sm1\n"> <"\tSubmodule sm1 0000000...$head4 (new submodule)\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [(C {(rm)} {(-rf)} {(sm1)}) (C {(git)} {(checkout-index)} {(sm1)})]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"typechanged submodule(submodule->blob)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head4...0000000 (submodule deleted)\n"> <"\tdiff --git a/sm1 b/sm1\n"> 
          <"\tnew file mode 100644\n"> <"\tindex 0000000..$head5\n"> <"\t--- /dev/null\n"> <"\t+++ b/sm1\n"> <"\t@@ -0,0 +1 @@\n"> <"\t+sm1\n"> 
          <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (C {(rm)} {(-f)} {(sm1)})
        (AndOr
          children: [
            (C {(test_create_repo)} {(sm1)})
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:head6)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(add_file)} {(sm1)} {(foo6)} {(foo7)})]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [716 724]
                      )
                    }
                  spids: [715]
                )
              ]
              spids: [715]
            )
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:fullhead6)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Sentence
                        child: (C {(cd)} {(sm1)})
                        terminator: <Op_Semi ";">
                      )
                      (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)})
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [727 740]
              )
            }
          spids: [726]
        )
      ]
      spids: [726]
    )
    (C {(test_expect_success)} {(SQ <"nonexistent commit">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head4...$head6 (commits not present)\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(commit_file)})
    (C {(test_expect_success)} {(SQ <"typechanged submodule(blob->submodule)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tdiff --git a/sm1 b/sm1\n"> <"\tdeleted file mode 100644\n"> <"\tindex $head5..0000000\n"> 
          <"\t--- a/sm1\n"> <"\t+++ /dev/null\n"> <"\t@@ -1 +0,0 @@\n"> <"\t-sm1\n"> 
          <"\tSubmodule sm1 0000000...$head6 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (C {(commit_file)} {(sm1)})
        (C {(test_expect_success)} {(SQ <"submodule is up to date">)} 
          {
            (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
              <"\tcat >expected <<-EOF &&\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
            )
          }
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"submodule contains untracked content">)} 
      {
        (SQ <"\n"> <"\techo new > sm1/new-file &&\n"> 
          <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains untracked content\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"submodule contains untracked content (untracked ignored)">)} 
      {
        (SQ <"\n"> 
          <"\tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n"> <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"submodule contains untracked content (dirty ignored)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n"> 
          <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"submodule contains untracked content (all ignored)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&\n"> 
          <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"submodule contains untracked and modifed content">)} 
      {
        (SQ <"\n"> <"\techo new > sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains untracked content\n"> 
          <"\tSubmodule sm1 contains modified content\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"submodule contains untracked and modifed content (untracked ignored)">)} 
      {
        (SQ <"\n"> <"\techo new > sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains modified content\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"submodule contains untracked and modifed content (dirty ignored)">)} 
      {
        (SQ <"\n"> <"\techo new > sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n"> <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"submodule contains untracked and modifed content (all ignored)">)} 
      {
        (SQ <"\n"> <"\techo new > sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --ignore-submodules --submodule=log HEAD >actual &&\n"> <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"submodule contains modifed content">)} 
      {
        (SQ <"\n"> <"\trm -f sm1/new-file &&\n"> 
          <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains modified content\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (Subshell
          child: 
            (CommandList
              children: [
                (Sentence child:(C {(cd)} {(sm1)}) terminator:<Op_Semi ";">)
                (SimpleCommand
                  words: [{(git)} {(commit)} {(-mchange)} {(foo6)}]
                  redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[954])]
                )
              ]
            )
          spids: [940 956]
        )
        (AndOr
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:head8)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Sentence
                                child: (C {(cd)} {(sm1)})
                                terminator: <Op_Semi ";">
                              )
                              (C {(git)} {(rev-parse)} {(--short)} {(--verify)} {(HEAD)})
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [961 976]
                      )
                    }
                  spids: [960]
                )
              ]
              spids: [960]
            )
            (C {(test_expect_success)} {(SQ <"submodule is modified">)} 
              {
                (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
                  <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
                )
              }
            )
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"modified submodule contains untracked content">)} 
      {
        (SQ <"\n"> <"\techo new > sm1/new-file &&\n"> 
          <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains untracked content\n"> 
          <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"modified submodule contains untracked content (untracked ignored)">)} 
      {
        (SQ <"\n"> 
          <"\tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"modified submodule contains untracked content (dirty ignored)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"modified submodule contains untracked content (all ignored)">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&\n"> 
          <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"modified submodule contains untracked and modifed content">)} 
      {
        (SQ <"\n"> <"\techo modification >> sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains untracked content\n"> 
          <"\tSubmodule sm1 contains modified content\n"> <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"modified submodule contains untracked and modifed content (untracked ignored)">)} 
      {
        (SQ <"\n"> <"\techo modification >> sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains modified content\n"> 
          <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"modified submodule contains untracked and modifed content (dirty ignored)">)} 
      {
        (SQ <"\n"> <"\techo modification >> sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> 
          <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} 
      {(SQ <"modified submodule contains untracked and modifed content (all ignored)">)} 
      {
        (SQ <"\n"> <"\techo modification >> sm1/foo6 &&\n"> 
          <"\tgit diff-index -p --ignore-submodules --submodule=log HEAD >actual &&\n"> <"\t! test -s actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"modified submodule contains modifed content">)} 
      {
        (SQ <"\n"> <"\trm -f sm1/new-file &&\n"> 
          <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 contains modified content\n"> 
          <"\tSubmodule sm1 $head6..$head8:\n"> <"\t  > change\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(rm)} {(-rf)} {(sm1)})
    (C {(test_expect_success)} {(SQ <"deleted submodule">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6...0000000 (submodule deleted)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (AndOr
      children: [
        (C {(test_create_repo)} {(sm2)})
        (AndOr
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:head7)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(add_file)} {(sm2)} {(foo8)} {(foo9)})]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [1182 1190]
                      )
                    }
                  spids: [1181]
                )
              ]
              spids: [1181]
            )
            (C {(git)} {(add)} {(sm2)})
          ]
          op_id: Op_DAmp
        )
      ]
      op_id: Op_DAmp
    )
    (C {(test_expect_success)} {(SQ <"multiple submodules">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6...0000000 (submodule deleted)\n"> 
          <"\tSubmodule sm2 0000000...$head7 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"path filter">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD sm2 >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm2 0000000...$head7 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(commit_file)} {(sm2)})
    (C {(test_expect_success)} {(SQ <"given commit">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=log HEAD^ >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6...0000000 (submodule deleted)\n"> 
          <"\tSubmodule sm2 0000000...$head7 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"given commit --submodule">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule HEAD^ >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tSubmodule sm1 $head6...0000000 (submodule deleted)\n"> 
          <"\tSubmodule sm2 0000000...$head7 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:fullhead7)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Sentence
                        child: (C {(cd)} {(sm2)})
                        terminator: <Op_Semi ";">
                      )
                      (C {(git)} {(rev-parse)} {(--verify)} {(HEAD)})
                    ]
                  )
                left_token: <Left_CommandSub "$(">
                spids: [1273 1286]
              )
            }
          spids: [1272]
        )
      ]
      spids: [1272]
    )
    (C {(test_expect_success)} {(SQ <"given commit --submodule=short">)} 
      {
        (SQ <"\n"> <"\tgit diff-index -p --submodule=short HEAD^ >actual &&\n"> 
          <"\tcat >expected <<-EOF &&\n"> <"\tdiff --git a/sm1 b/sm1\n"> <"\tdeleted file mode 160000\n"> <"\tindex $head6..0000000\n"> 
          <"\t--- a/sm1\n"> <"\t+++ /dev/null\n"> <"\t@@ -1 +0,0 @@\n"> <"\t-Subproject commit $fullhead6\n"> 
          <"\tdiff --git a/sm2 b/sm2\n"> <"\tnew file mode 160000\n"> <"\tindex 0000000..$head7\n"> <"\t--- /dev/null\n"> <"\t+++ b/sm2\n"> 
          <"\t@@ -0,0 +1 @@\n"> <"\t+Subproject commit $fullhead7\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"setup .git file for sm2">)} 
      {
        (SQ <"\n"> <"\t(cd sm2 &&\n"> <"\t REAL=\"$(pwd)/../.real\" &&\n"> <"\t mv .git \"$REAL\"\n"> 
          <"\t echo \"gitdir: $REAL\" >.git)\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff --submodule with .git file">)} 
      {
        (SQ <"\n"> <"\tgit diff --submodule HEAD^ >actual &&\n"> <"\tcat >expected <<-EOF &&\n"> 
          <"\tSubmodule sm1 $head6...0000000 (submodule deleted)\n"> <"\tSubmodule sm2 0000000...$head7 (new submodule)\n"> <"\tEOF\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_expect_success)} {(SQ <"diff --submodule with objects referenced by alternates">)} 
      {
        (SQ <"\n"> <"\tmkdir sub_alt &&\n"> <"\t(cd sub_alt &&\n"> <"\t\tgit init &&\n"> 
          <"\t\techo a >a &&\n"> <"\t\tgit add a &&\n"> <"\t\tgit commit -m a\n"> <"\t) &&\n"> <"\tmkdir super &&\n"> <"\t(cd super &&\n"> 
          <"\t\tgit clone -s ../sub_alt sub &&\n"> <"\t\tgit init &&\n"> <"\t\tgit add sub &&\n"> <"\t\tgit commit -m \"sub a\"\n"> <"\t) &&\n"> 
          <"\t(cd sub_alt &&\n"> <"\t\tsha1_before=$(git rev-parse --short HEAD)\n"> <"\t\techo b >b &&\n"> <"\t\tgit add b &&\n"> 
          <"\t\tgit commit -m b &&\n"> <"\t\tsha1_after=$(git rev-parse --short HEAD) &&\n"> <"\t\t{\n"> 
          <"\t\t\techo \"Submodule sub $sha1_before..$sha1_after:\" &&\n"> <"\t\t\techo \"  > b\"\n"> <"\t\t} >../expected\n"> <"\t) &&\n"> <"\t(cd super &&\n"> 
          <"\t\t(cd sub &&\n"> <"\t\t\tgit fetch &&\n"> <"\t\t\tgit checkout origin/master\n"> <"\t\t) &&\n"> 
          <"\t\tgit diff --submodule > ../actual\n"> <"\t) &&\n"> <"\ttest_cmp expected actual\n">
        )
      }
    )
    (C {(test_done)})
  ]
)