(command.CommandList
  children: [
    (command.ShAssignment
      left: <Id.Lit_VarLike 'test_description='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'test_description='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'diff function context'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'dir='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'dir='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dir='> name:dir)
          op: assign_op.Equal
          rhs: {(DQ ($ Id.VSub_DollarName TEST_DIRECTORY) <'/t4051'>)}
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name_tok: <commit_and_tag>
      name: commit_and_tag
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.AndOr
              children: [
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'tag='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'tag='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tag='> name:tag)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_Number 1)}
                    )
                  ]
                  redirects: []
                )
                (command.Simple
                  blame_tok: <shift>
                  more_env: []
                  words: [{<shift>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<add>} {(DQ ($ Id.VSub_At '@'))}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_tick>
                  more_env: []
                  words: [{<test_tick>}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<commit>} {<-m>} {(DQ ($ Id.VSub_DollarName tag))}]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [{<git>} {<tag>} {(DQ ($ Id.VSub_DollarName tag))}]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <first_context_line>
      name: first_context_line
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <awk>
              more_env: []
              words: [
                {<awk>}
                {(SQ <'\n'> <'\t\tfound {print; exit}\n'> <'\t\t/^@@/ {found = 1}\n'> <'\t'>)}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <last_context_line>
      name: last_context_line
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <sed>
              more_env: []
              words: [
                {<sed>}
                {<-ne>}
                {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <p>}
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.ShFunction
      name_tok: <check_diff>
      name: check_diff
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'name='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'name='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'name='> name:name)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 1)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'desc='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'desc='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'desc='> name:desc)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number 2)}
                )
              ]
              redirects: []
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'options='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'options='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'options='> name:options)
                  op: assign_op.Equal
                  rhs: {(DQ <'-W '> ($ Id.VSub_Number 3))}
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(DQ ($ Id.VSub_DollarName desc))}
                {(SQ <'\n'> <'\t\tgit diff $options "$name^" "$name" >"$name.diff"\n'> <'\t'>)}
              ]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <test_expect_success>
              more_env: []
              words: [
                {<test_expect_success>}
                {(SQ <' diff applies'>)}
                {
                  (SQ <'\n'> <'\t\ttest_when_finished "git reset --hard" &&\n'> 
                    <'\t\tgit checkout --detach "$name^" &&\n'> <'\t\tgit apply --index "$name.diff" &&\n'> <'\t\tgit diff --exit-code "$name"\n'> <'\t'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <setup>)}
        {
          (SQ <'\n'> <'\tcat "$dir/includes.c" "$dir/dummy.c" "$dir/dummy.c" "$dir/hello.c" \\\n'> 
            <'\t\t"$dir/dummy.c" "$dir/dummy.c" >file.c &&\n'> <'\tcommit_and_tag initial file.c &&\n'> <'\n'> 
            <'\tgrep -v "delete me from hello" <file.c >file.c.new &&\n'> <'\tmv file.c.new file.c &&\n'> <'\tcommit_and_tag changed_hello file.c &&\n'> <'\n'> 
            <'\tgrep -v "delete me from includes" <file.c >file.c.new &&\n'> <'\tmv file.c.new file.c &&\n'> <'\tcommit_and_tag changed_includes file.c &&\n'> <'\n'> 
            <'\tcat "$dir/appended1.c" >>file.c &&\n'> <'\tcommit_and_tag appended file.c &&\n'> <'\n'> <'\tcat "$dir/appended2.c" >>file.c &&\n'> 
            <'\tcommit_and_tag extended file.c &&\n'> <'\n'> <'\tgrep -v "Begin of second part" <file.c >file.c.new &&\n'> <'\tmv file.c.new file.c &&\n'> 
            <'\tcommit_and_tag long_common_tail file.c &&\n'> <'\n'> <'\tgit checkout initial &&\n'> <'\tcat "$dir/hello.c" "$dir/dummy.c" >file.c &&\n'> 
            <'\tcommit_and_tag hello_dummy file.c &&\n'> <'\n'> <'\t# overlap function context of 1st change and -u context of 2nd change\n'> 
            <'\tgrep -v "delete me from hello" <"$dir/hello.c" >file.c &&\n'> <'\tsed 2p <"$dir/dummy.c" >>file.c &&\n'> <'\tcommit_and_tag changed_hello_dummy file.c &&\n'> <'\n'> 
            <'\tgit checkout initial &&\n'> <'\tgrep -v "delete me from hello" <file.c >file.c.new &&\n'> <'\tmv file.c.new file.c &&\n'> 
            <'\tcat "$dir/appended1.c" >>file.c &&\n'> <'\tcommit_and_tag changed_hello_appended file.c\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [{<check_diff>} {<changed_hello>} {(SQ <'changed function'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {(SQ <'\n'> <'\tgrep "^ .*Begin of hello" changed_hello.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {(SQ <'\n'> <'\tgrep "^ .*End of hello" changed_hello.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include other functions'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^[ +-].*Begin" changed_hello.diff) -le 1\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include preceding empty lines'>)}
        {(SQ <'\n'> <'\ttest "$(first_context_line <changed_hello.diff)" != " "\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include trailing empty lines'>)}
        {(SQ <'\n'> <'\ttest "$(last_context_line <changed_hello.diff)" != " "\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [{<check_diff>} {<changed_includes>} {(SQ <'changed includes'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {(SQ <'\n'> <'\tgrep "^ .*Begin.h" changed_includes.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {(SQ <'\n'> <'\tgrep "^ .*End.h" changed_includes.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include other functions'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^[ +-].*Begin" changed_includes.diff) -le 1\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include trailing empty lines'>)}
        {(SQ <'\n'> <'\ttest "$(last_context_line <changed_includes.diff)" != " "\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [{<check_diff>} {<appended>} {(SQ <'appended function'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {(SQ <'\n'> <'\tgrep "^[+].*Begin of first part" appended.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {(SQ <'\n'> <'\tgrep "^[+].*End of first part" appended.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include other functions'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^[ +-].*Begin" appended.diff) -le 1\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [{<check_diff>} {<extended>} {(SQ <'appended function part'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {(SQ <'\n'> <'\tgrep "^ .*Begin of first part" extended.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {(SQ <'\n'> <'\tgrep "^[+].*End of second part" extended.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include other functions'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^[ +-].*Begin" extended.diff) -le 2\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include preceding empty lines'>)}
        {(SQ <'\n'> <'\ttest "$(first_context_line <extended.diff)" != " "\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [
        {<check_diff>}
        {<long_common_tail>}
        {(SQ <'change with long common tail and no context'>)}
        {<-U0>}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {(SQ <'\n'> <'\tgrep "^ .*Begin of first part" long_common_tail.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {(SQ <'\n'> <'\tgrep "^ .*End of second part" long_common_tail.diff\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include other functions'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^[ +-].*Begin" long_common_tail.diff) -le 2\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include preceding empty lines'>)}
        {(SQ <'\n'> <'\ttest "$(first_context_line <long_common_tail.diff.diff)" != " "\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [
        {<check_diff>}
        {<changed_hello_appended>}
        {(SQ <'changed function plus appended function'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {
          (SQ <'\n'> <'\tgrep "^ .*Begin of hello" changed_hello_appended.diff &&\n'> 
            <'\tgrep "^[+].*Begin of first part" changed_hello_appended.diff\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {
          (SQ <'\n'> <'\tgrep "^ .*End of hello" changed_hello_appended.diff &&\n'> 
            <'\tgrep "^[+].*End of first part" changed_hello_appended.diff\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context does not include other functions'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^[ +-].*Begin" changed_hello_appended.diff) -le 2\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <check_diff>
      more_env: []
      words: [{<check_diff>} {<changed_hello_dummy>} {(SQ <'changed two consecutive functions'>)}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes begin'>)}
        {
          (SQ <'\n'> <'\tgrep "^ .*Begin of hello" changed_hello_dummy.diff &&\n'> 
            <'\tgrep "^ .*Begin of dummy" changed_hello_dummy.diff\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' context includes end'>)}
        {
          (SQ <'\n'> <'\tgrep "^ .*End of hello" changed_hello_dummy.diff &&\n'> 
            <'\tgrep "^ .*End of dummy" changed_hello_dummy.diff\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <' overlapping hunks are merged'>)}
        {(SQ <'\n'> <'\ttest $(grep -c "^@@" changed_hello_dummy.diff) -eq 1\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)