(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 <'Test merging of notes trees'>)}
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <.>
      more_env: []
      words: [{<.>} {<'./test-lib.sh'>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {<setup>}
        {
          (SQ <'\n'> <'\ttest_commit 1st &&\n'> <'\ttest_commit 2nd &&\n'> <'\ttest_commit 3rd &&\n'> 
            <'\ttest_commit 4th &&\n'> <'\ttest_commit 5th &&\n'> <'\t# Create notes on 4 first commits\n'> 
            <'\tgit config core.notesRef refs/notes/x &&\n'> <'\tgit notes add -m "Notes on 1st commit" 1st &&\n'> 
            <'\tgit notes add -m "Notes on 2nd commit" 2nd &&\n'> <'\tgit notes add -m "Notes on 3rd commit" 3rd &&\n'> 
            <'\tgit notes add -m "Notes on 4th commit" 4th &&\n'> <'\t# Copy notes to remote-notes\n'> <'\tgit fetch . refs/notes/*:refs/remote-notes/origin/*\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit_sha1='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit_sha1='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit_sha1='> name:commit_sha1)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [
                      {<git>}
                      {<rev-parse>}
                      {<1st> <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <commit> <Id.Lit_RBrace '}'>}
                    ]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit_sha2='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit_sha2='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit_sha2='> name:commit_sha2)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [
                      {<git>}
                      {<rev-parse>}
                      {<2nd> <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <commit> <Id.Lit_RBrace '}'>}
                    ]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit_sha3='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit_sha3='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit_sha3='> name:commit_sha3)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [
                      {<git>}
                      {<rev-parse>}
                      {<3rd> <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <commit> <Id.Lit_RBrace '}'>}
                    ]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit_sha4='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit_sha4='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit_sha4='> name:commit_sha4)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [
                      {<git>}
                      {<rev-parse>}
                      {<4th> <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <commit> <Id.Lit_RBrace '}'>}
                    ]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'commit_sha5='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'commit_sha5='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'commit_sha5='> name:commit_sha5)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <git>
                    more_env: []
                    words: [
                      {<git>}
                      {<rev-parse>}
                      {<5th> <Id.Lit_Other '^'> <Id.Lit_LBrace '{'> <commit> <Id.Lit_RBrace '}'>}
                    ]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShFunction
      name_tok: <verify_notes>
      name: verify_notes
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'notes_ref='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'notes_ref='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'notes_ref='> name:notes_ref)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number 1))}
                )
              ]
              redirects: []
            )
            (command.AndOr
              children: [
                (command.Pipeline
                  children: [
                    (command.Simple
                      blame_tok: <git>
                      more_env: []
                      words: [
                        {<git>}
                        {<-c>}
                        {<core.notesRef> <Id.Lit_Equals '='> 
                          (DQ <'refs/notes/'> ($ Id.VSub_DollarName notes_ref))
                        }
                        {<notes>}
                      ]
                      redirects: []
                      do_fork: T
                    )
                    (command.Simple
                      blame_tok: <sort>
                      more_env: []
                      words: [{<sort>}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_Great '>'>
                          loc: (redir_loc.Fd fd:1)
                          arg: {(DQ <output_notes_> ($ Id.VSub_DollarName notes_ref))}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  ops: [<Id.Op_Pipe _>]
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [
                    {<test_cmp>}
                    {(DQ <expect_notes_> ($ Id.VSub_DollarName notes_ref))}
                    {(DQ <output_notes_> ($ Id.VSub_DollarName notes_ref))}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <git>
                  more_env: []
                  words: [
                    {<git>}
                    {<-c>}
                    {<core.notesRef> <Id.Lit_Equals '='> 
                      (DQ <'refs/notes/'> ($ Id.VSub_DollarName notes_ref))
                    }
                    {<log>}
                    {<--format> <Id.Lit_Equals '='> (DQ <'%H %s%n%N'>)}
                  ]
                  redirects: [
                    (Redir
                      op: <Id.Redir_Great '>'>
                      loc: (redir_loc.Fd fd:1)
                      arg: {(DQ <output_log_> ($ Id.VSub_DollarName notes_ref))}
                    )
                  ]
                  do_fork: T
                )
                (command.Simple
                  blame_tok: <test_cmp>
                  more_env: []
                  words: [
                    {<test_cmp>}
                    {(DQ <expect_log_> ($ Id.VSub_DollarName notes_ref))}
                    {(DQ <output_log_> ($ Id.VSub_DollarName notes_ref))}
                  ]
                  redirects: []
                  do_fork: T
                )
              ]
              ops: [<Id.Op_DAmp _> <Id.Op_DAmp _> <Id.Op_DAmp _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'5e93d24084d32e1cb61f7070505b9d2530cca987 '>
                    ($ Id.VSub_DollarName commit_sha4)
                    <'\n'>
                    <'8366731eeee53787d2bdf8fc1eff7d94757e8da0 '>
                    ($ Id.VSub_DollarName commit_sha3)
                    <'\n'>
                    <'eede89064cd42441590d6afec6c37b321ada3389 '>
                    ($ Id.VSub_DollarName commit_sha2)
                    <'\n'>
                    <'daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 '>
                    ($ Id.VSub_DollarName commit_sha1)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_x>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_x>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'Notes on 4th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'Notes on 3rd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'Notes on 2nd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'Notes on 1st commit\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'verify initial notes (x)'>)}
        {(SQ <'\n'> <'\tverify_notes x\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<expect_notes_x>} {<expect_notes_y>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<expect_notes_x>} {<expect_notes_v>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<expect_log_x>} {<expect_log_y>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<expect_log_x>} {<expect_log_v>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'fail to merge empty notes ref into empty notes ref (z => y)'>)}
        {(SQ <'\n'> <'\ttest_must_fail git -c "core.notesRef=refs/notes/y" notes merge z\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'fail to merge into various non-notes refs'>)}
        {
          (SQ <'\n'> <'\ttest_must_fail git -c "core.notesRef=refs/notes" notes merge x &&\n'> 
            <'\ttest_must_fail git -c "core.notesRef=refs/notes/" notes merge x &&\n'> <'\tmkdir -p .git/refs/notes/dir &&\n'> 
            <'\ttest_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x &&\n'> <'\ttest_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x &&\n'> 
            <'\ttest_must_fail git -c "core.notesRef=refs/heads/master" notes merge x &&\n'> <'\ttest_must_fail git -c "core.notesRef=refs/notes/y:" notes merge x &&\n'> 
            <'\ttest_must_fail git -c "core.notesRef=refs/notes/y:foo" notes merge x &&\n'> <'\ttest_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge non-notes ref into empty notes ref (remote-notes/origin/x => v)'>)}
        {
          (SQ <'\n'> <'\tgit config core.notesRef refs/notes/v &&\n'> 
            <'\tgit notes merge refs/remote-notes/origin/x &&\n'> <'\tverify_notes v &&\n'> 
            <'\t# refs/remote-notes/origin/x and v should point to the same notes commit\n'> <'\ttest "$(git rev-parse refs/remote-notes/origin/x)" = "$(git rev-parse refs/notes/v)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge notes into empty notes ref (x => y)'>)}
        {
          (SQ <'\n'> <'\tgit config core.notesRef refs/notes/y &&\n'> <'\tgit notes merge x &&\n'> 
            <'\tverify_notes y &&\n'> <'\t# x and y should point to the same notes commit\n'> 
            <'\ttest "$(git rev-parse refs/notes/x)" = "$(git rev-parse refs/notes/y)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge empty notes ref (z => y)'>)}
        {
          (SQ <'\n'> <'\tgit notes merge z &&\n'> <'\t# y should not change (still == x)\n'> 
            <'\ttest "$(git rev-parse refs/notes/x)" = "$(git rev-parse refs/notes/y)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'change notes on other notes ref (y)'>)}
        {
          (SQ <'\n'> <'\t# Not touching notes to 1st commit\n'> <'\tgit notes remove 2nd &&\n'> 
            <'\tgit notes append -m "More notes on 3rd commit" 3rd &&\n'> <'\tgit notes add -f -m "New notes on 4th commit" 4th &&\n'> 
            <'\tgit notes add -m "Notes on 5th commit" 5th\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge previous notes commit (y^ => y) => No-op'>)}
        {
          (SQ <'\n'> <'\tpre_state="$(git rev-parse refs/notes/y)" &&\n'> <'\tgit notes merge y^ &&\n'> 
            <'\t# y should not move\n'> <'\ttest "$pre_state" = "$(git rev-parse refs/notes/y)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'0f2efbd00262f2fd41dfae33df8765618eeacd99 '>
                    ($ Id.VSub_DollarName commit_sha5)
                    <'\n'>
                    <'dec2502dac3ea161543f71930044deff93fa945c '>
                    ($ Id.VSub_DollarName commit_sha4)
                    <'\n'>
                    <'4069cdb399fd45463ec6eef8e051a16a03592d91 '>
                    ($ Id.VSub_DollarName commit_sha3)
                    <'\n'>
                    <'daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 '>
                    ($ Id.VSub_DollarName commit_sha1)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_y>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_y>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'Notes on 5th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'New notes on 4th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'Notes on 3rd commit\n'>
                <'\n'>
                <'More notes on 3rd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'Notes on 1st commit\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'verify changed notes on other notes ref (y)'>)}
        {(SQ <'\n'> <'\tverify_notes y\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'verify unchanged notes on original notes ref (x)'>)}
        {(SQ <'\n'> <'\tverify_notes x\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge original notes (x) into changed notes (y) => No-op'>)}
        {
          (SQ <'\n'> <'\tgit notes merge -vvv x &&\n'> <'\tverify_notes y &&\n'> <'\tverify_notes x\n'>)
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<expect_notes_y>} {<expect_notes_x>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <cp>
      more_env: []
      words: [{<cp>} {<expect_log_y>} {<expect_log_x>}]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge changed (y) into original (x) => Fast-forward'>)}
        {
          (SQ <'\n'> <'\tgit config core.notesRef refs/notes/x &&\n'> <'\tgit notes merge y &&\n'> 
            <'\tverify_notes x &&\n'> <'\tverify_notes y &&\n'> <'\t# x and y should point to same the notes commit\n'> 
            <'\ttest "$(git rev-parse refs/notes/x)" = "$(git rev-parse refs/notes/y)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge empty notes ref (z => y)'>)}
        {
          (SQ <'\n'> <'\t# Prepare empty (but valid) notes ref (z)\n'> 
            <'\tgit config core.notesRef refs/notes/z &&\n'> <'\tgit notes add -m "foo" &&\n'> <'\tgit notes remove &&\n'> <'\tgit notes >output_notes_z &&\n'> 
            <'\ttest_cmp /dev/null output_notes_z &&\n'> <'\t# Do the merge (z => y)\n'> <'\tgit config core.notesRef refs/notes/y &&\n'> 
            <'\tgit notes merge z &&\n'> <'\tverify_notes y &&\n'> <'\t# y should no longer point to the same notes commit as x\n'> 
            <'\ttest "$(git rev-parse refs/notes/x)" != "$(git rev-parse refs/notes/y)"\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'0f2efbd00262f2fd41dfae33df8765618eeacd99 '>
                    ($ Id.VSub_DollarName commit_sha5)
                    <'\n'>
                    <'dec2502dac3ea161543f71930044deff93fa945c '>
                    ($ Id.VSub_DollarName commit_sha4)
                    <'\n'>
                    <'4069cdb399fd45463ec6eef8e051a16a03592d91 '>
                    ($ Id.VSub_DollarName commit_sha3)
                    <'\n'>
                    <'d000d30e6ddcfce3a8122c403226a2ce2fd04d9d '>
                    ($ Id.VSub_DollarName commit_sha2)
                    <'\n'>
                    <'43add6bd0c8c0bc871ac7991e0f5573cfba27804 '>
                    ($ Id.VSub_DollarName commit_sha1)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_y>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_y>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'Notes on 5th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'New notes on 4th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'Notes on 3rd commit\n'>
                <'\n'>
                <'More notes on 3rd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'New notes on 2nd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'Notes on 1st commit\n'>
                <'\n'>
                <'More notes on 1st commit\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'change notes on other notes ref (y)'>)}
        {
          (SQ <'\n'> <'\t# Append to 1st commit notes\n'> 
            <'\tgit notes append -m "More notes on 1st commit" 1st &&\n'> <'\t# Add new notes to 2nd commit\n'> <'\tgit notes add -m "New notes on 2nd commit" 2nd &&\n'> 
            <'\tverify_notes y\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'0f2efbd00262f2fd41dfae33df8765618eeacd99 '>
                    ($ Id.VSub_DollarName commit_sha5)
                    <'\n'>
                    <'1f257a3a90328557c452f0817d6cc50c89d315d4 '>
                    ($ Id.VSub_DollarName commit_sha4)
                    <'\n'>
                    <'daa55ffad6cb99bf64226532147ffcaf5ce8bdd1 '>
                    ($ Id.VSub_DollarName commit_sha1)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_x>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_x>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'Notes on 5th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'New notes on 4th commit\n'>
                <'\n'>
                <'More notes on 4th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'Notes on 1st commit\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'change notes on notes ref (x)'>)}
        {
          (SQ <'\n'> <'\tgit config core.notesRef refs/notes/x &&\n'> <'\tgit notes remove 3rd &&\n'> 
            <'\tgit notes append -m "More notes on 4th commit" 4th &&\n'> <'\tverify_notes x\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'0f2efbd00262f2fd41dfae33df8765618eeacd99 '>
                    ($ Id.VSub_DollarName commit_sha5)
                    <'\n'>
                    <'1f257a3a90328557c452f0817d6cc50c89d315d4 '>
                    ($ Id.VSub_DollarName commit_sha4)
                    <'\n'>
                    <'d000d30e6ddcfce3a8122c403226a2ce2fd04d9d '>
                    ($ Id.VSub_DollarName commit_sha2)
                    <'\n'>
                    <'43add6bd0c8c0bc871ac7991e0f5573cfba27804 '>
                    ($ Id.VSub_DollarName commit_sha1)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_x>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_x>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'Notes on 5th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'New notes on 4th commit\n'>
                <'\n'>
                <'More notes on 4th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'New notes on 2nd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'Notes on 1st commit\n'>
                <'\n'>
                <'More notes on 1st commit\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge y into x => Non-conflicting 3-way merge'>)}
        {(SQ <'\n'> <'\tgit notes merge y &&\n'> <'\tverify_notes x &&\n'> <'\tverify_notes y\n'>)}
      ]
      redirects: []
      do_fork: T
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'05a4927951bcef347f51486575b878b2b60137f2 '>
                    ($ Id.VSub_DollarName commit_sha3)
                    <'\n'>
                    <'d000d30e6ddcfce3a8122c403226a2ce2fd04d9d '>
                    ($ Id.VSub_DollarName commit_sha2)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_w>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_w>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'New notes on 3rd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'New notes on 2nd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'create notes on new, separate notes ref (w)'>)}
        {
          (SQ <'\n'> <'\tgit config core.notesRef refs/notes/w &&\n'> 
            <'\t# Add same note as refs/notes/y on 2nd commit\n'> <'\tgit notes add -m "New notes on 2nd commit" 2nd &&\n'> 
            <'\t# Add new note on 3rd commit (non-conflicting)\n'> <'\tgit notes add -m "New notes on 3rd commit" 3rd &&\n'> 
            <'\t# Verify state of notes on new, separate notes ref (w)\n'> <'\tverify_notes w\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Pipeline
      children: [
        (command.Simple
          blame_tok: <cat>
          more_env: []
          words: [{<cat>}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {<EOF>}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'0f2efbd00262f2fd41dfae33df8765618eeacd99 '>
                    ($ Id.VSub_DollarName commit_sha5)
                    <'\n'>
                    <'1f257a3a90328557c452f0817d6cc50c89d315d4 '>
                    ($ Id.VSub_DollarName commit_sha4)
                    <'\n'>
                    <'05a4927951bcef347f51486575b878b2b60137f2 '>
                    ($ Id.VSub_DollarName commit_sha3)
                    <'\n'>
                    <'d000d30e6ddcfce3a8122c403226a2ce2fd04d9d '>
                    ($ Id.VSub_DollarName commit_sha2)
                    <'\n'>
                    <'43add6bd0c8c0bc871ac7991e0f5573cfba27804 '>
                    ($ Id.VSub_DollarName commit_sha1)
                    <'\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <sort>
          more_env: []
          words: [{<sort>}]
          redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_notes_x>})]
          do_fork: T
        )
      ]
      ops: [<Id.Op_Pipe _>]
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<expect_log_x>})
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<EOF>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                ($ Id.VSub_DollarName commit_sha5)
                <' 5th\n'>
                <'Notes on 5th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha4)
                <' 4th\n'>
                <'New notes on 4th commit\n'>
                <'\n'>
                <'More notes on 4th commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha3)
                <' 3rd\n'>
                <'New notes on 3rd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha2)
                <' 2nd\n'>
                <'New notes on 2nd commit\n'>
                <'\n'>
                ($ Id.VSub_DollarName commit_sha1)
                <' 1st\n'>
                <'Notes on 1st commit\n'>
                <'\n'>
                <'More notes on 1st commit\n'>
                <'\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_expect_success>
      more_env: []
      words: [
        {<test_expect_success>}
        {(SQ <'merge w into x => Non-conflicting history-less merge'>)}
        {
          (SQ <'\n'> <'\tgit config core.notesRef refs/notes/x &&\n'> <'\tgit notes merge w &&\n'> 
            <'\t# Verify new state of notes on other notes ref (x)\n'> <'\tverify_notes x &&\n'> <'\t# Also verify that nothing changed on other notes refs (y and w)\n'> 
            <'\tverify_notes y &&\n'> <'\tverify_notes w\n'>
          )
        }
      ]
      redirects: []
      do_fork: T
    )
    (command.Simple
      blame_tok: <test_done>
      more_env: []
      words: [{<test_done>}]
      redirects: []
      do_fork: T
    )
  ]
)