(List
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('test_description', {[SQ <LIT_CHARS "Test notes merging at various fanout levels">]})])
  (Com {[LIT_CHARS .]} {[LIT_CHARS ./test-lib.sh]}  )
  (FunctionDef verify_notes []
    (List
      (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('notes_ref', {[DQ [VarSub 1]]})])
      (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('commit', {[DQ [VarSub 2]]})])
      (AndOr OP_AND_IF
        (If
          (Com {[LIT_CHARS test]} {[LIT_CHARS -f]} {[DQ [LIT_CHARS expect_notes_][VarSub notes_ref]]}          )
          (AndOr OP_AND_IF
            (Pipeline
              (Com {[LIT_CHARS git]} {[LIT_CHARS -c]} {[LIT_CHARS core.notesRef] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS refs/notes/][VarSub notes_ref]]} {[LIT_CHARS notes]}              )
              (Com {[LIT_CHARS sort]}
                <
                (FilenameRedirectNode filename={[DQ [LIT_CHARS output_notes_][VarSub notes_ref]]} <REDIR_GREAT ">"> 1),
                >
              )
            )
            (AndOr OP_OR_IF
              (Com {[LIT_CHARS test_cmp]} {[DQ [LIT_CHARS expect_notes_][VarSub notes_ref]]} {[DQ [LIT_CHARS output_notes_][VarSub notes_ref]]}              )
              (Com {[LIT_CHARS return]} {[LIT_CHARS 1]}              )
            )
          )
        )
        (AndOr OP_AND_IF
          (Com {[LIT_CHARS git]} {[LIT_CHARS -c]} {[LIT_CHARS core.notesRef] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS refs/notes/][VarSub notes_ref]]} {[LIT_CHARS log]} {[LIT_CHARS --format] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS "%H %s%n%N"]]} {[DQ [VarSub commit]]}
            <
            (FilenameRedirectNode filename={[DQ [LIT_CHARS output_log_][VarSub notes_ref]]} <REDIR_GREAT ">"> 1),
            >
          )
          (Com {[LIT_CHARS test_cmp]} {[DQ [LIT_CHARS expect_log_][VarSub notes_ref]]} {[DQ [LIT_CHARS output_log_][VarSub notes_ref]]}          )
        )
      )
    )
  )
  (FunctionDef verify_fanout []
    (List
      (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('notes_ref', {[DQ [VarSub 1]]})])
      (AndOr OP_AND_IF
        (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --quiet]} {[LIT_CHARS --verify]} {[DQ [LIT_CHARS refs/notes/][VarSub notes_ref]]}
          <
          (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} <REDIR_GREAT ">"> 1),
          >
        )
        (Pipeline
          (Com {[LIT_CHARS git]} {[LIT_CHARS ls-tree]} {[LIT_CHARS -r]} {[LIT_CHARS --name-only]} {[DQ [LIT_CHARS refs/notes/][VarSub notes_ref]]}          )
          (While
            (Com {[LIT_CHARS read]} {[LIT_CHARS path]}            )
            (Case to_match={[DQ [VarSub path]]}, pat_word_list=[[{[LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_CHARS /] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"]}], [{[LIT_OTHER "*"]}]]
              (Com {[LIT_OTHER ":"]} {[LIT_CHARS true]}              )
              (AndOr OP_AND_IF
                (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Invalid path "][\ LIT_ESCAPED_CHAR "\\\""][VarSub path][\ LIT_ESCAPED_CHAR "\\\""]]}                )
                (Com {[LIT_CHARS return]} {[LIT_CHARS 1]}                )
              )
            )
          )
        )
      )
    )
  )
  (FunctionDef verify_no_fanout []
    (List
      (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('notes_ref', {[DQ [VarSub 1]]})])
      (AndOr OP_AND_IF
        (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS --quiet]} {[LIT_CHARS --verify]} {[DQ [LIT_CHARS refs/notes/][VarSub notes_ref]]}
          <
          (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} <REDIR_GREAT ">"> 1),
          >
        )
        (Pipeline
          (Com {[LIT_CHARS git]} {[LIT_CHARS ls-tree]} {[LIT_CHARS -r]} {[LIT_CHARS --name-only]} {[DQ [LIT_CHARS refs/notes/][VarSub notes_ref]]}          )
          (While
            (Com {[LIT_CHARS read]} {[LIT_CHARS path]}            )
            (Case to_match={[DQ [VarSub path]]}, pat_word_list=[[{[LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"] [LIT_OTHER "?"]}], [{[LIT_OTHER "*"]}]]
              (Com {[LIT_OTHER ":"]} {[LIT_CHARS true]}              )
              (AndOr OP_AND_IF
                (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Invalid path "][\ LIT_ESCAPED_CHAR "\\\""][VarSub path][\ LIT_ESCAPED_CHAR "\\\""]]}                )
                (Com {[LIT_CHARS return]} {[LIT_CHARS 1]}                )
              )
            )
          )
        )
      )
    )
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "setup a few initial commits with notes (notes ref: x)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/x &&\n"> <LIT_CHARS "\tfor i in 1 2 3 4 5\n"> <LIT_CHARS "\tdo\n"> <LIT_CHARS "\t\ttest_commit \"commit$i\" >/dev/null &&\n"> <LIT_CHARS "\t\tgit notes add -m \"notes for commit$i\" || return 1\n"> <LIT_CHARS "\tdone\n">]}  )
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('commit_sha1', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS commit1] [LIT_OTHER "^"] [LIT_LBRACE "{"] [LIT_CHARS commit] [LIT_RBRACE "}"]})]})])
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('commit_sha2', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS commit2] [LIT_OTHER "^"] [LIT_LBRACE "{"] [LIT_CHARS commit] [LIT_RBRACE "}"]})]})])
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('commit_sha3', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS commit3] [LIT_OTHER "^"] [LIT_LBRACE "{"] [LIT_CHARS commit] [LIT_RBRACE "}"]})]})])
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('commit_sha4', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS commit4] [LIT_OTHER "^"] [LIT_LBRACE "{"] [LIT_CHARS commit] [LIT_RBRACE "}"]})]})])
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('commit_sha5', {[ComSub (Com {[LIT_CHARS git]} {[LIT_CHARS rev-parse]} {[LIT_CHARS commit5] [LIT_OTHER "^"] [LIT_LBRACE "{"] [LIT_CHARS commit] [LIT_RBRACE "}"]})]})])
  (Pipeline
    (Com {[LIT_CHARS cat]}
      <
      (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [LIT_CHARS "aed91155c7a72c2188e781fdf40e0f3761b299db "][VarSub commit_sha5][LIT_CHARS "\n"][LIT_CHARS "99fab268f9d7ee7b011e091a436c78def8eeee69 "][VarSub commit_sha4][LIT_CHARS "\n"][LIT_CHARS "953c20ae26c7aa0b428c20693fe38bc687f9d1a9 "][VarSub commit_sha3][LIT_CHARS "\n"][LIT_CHARS "6358796131b8916eaa2dde6902642942a1cb37e1 "][VarSub commit_sha2][LIT_CHARS "\n"][LIT_CHARS "b02d459c32f0e68f2fe0981033bb34f38776ba47 "][VarSub commit_sha1][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
      >
    )
    (Com {[LIT_CHARS sort]}
      <
      (FilenameRedirectNode filename={[LIT_CHARS expect_notes_x]} <REDIR_GREAT ">"> 1),
      >
    )
  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_x]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "notes for commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "notes for commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "sanity check (x)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_no_fanout x\n">]}  )
  (= scope=<EAssignScope.GLOBAL 1> flags=0 words=[] bindings=[('num', {[LIT_CHARS 300]})])
  (Com {[LIT_CHARS cp]} {[LIT_CHARS expect_log_x]} {[LIT_CHARS expect_log_y]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "Add a few hundred commits w/notes to trigger fanout (x -> y)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/y refs/notes/x &&\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/y &&\n"> <LIT_CHARS "\ti=5 &&\n"> <LIT_CHARS "\twhile test $i -lt $num\n"> <LIT_CHARS "\tdo\n"> <LIT_CHARS "\t\ti=$(($i + 1)) &&\n"> <LIT_CHARS "\t\ttest_commit \"commit$i\" >/dev/null &&\n"> <LIT_CHARS "\t\tgit notes add -m \"notes for commit$i\" || return 1\n"> <LIT_CHARS "\tdone &&\n"> <LIT_CHARS "\ttest \"$(git rev-parse refs/notes/y)\" != \"$(git rev-parse refs/notes/x)\" &&\n"> <LIT_CHARS "\t# Expected number of commits and notes\n"> <LIT_CHARS "\ttest $(git rev-list HEAD | wc -l) = $num &&\n"> <LIT_CHARS "\ttest $(git notes list | wc -l) = $num &&\n"> <LIT_CHARS "\t# 5 first notes unchanged\n"> <LIT_CHARS "\tverify_notes y commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree has fanout (y)">]} {[SQ <LIT_CHARS "verify_fanout y">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "No-op merge (already included) (x => y)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/y &&\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/m &&\n"> <LIT_CHARS "\tgit notes merge x &&\n"> <LIT_CHARS "\ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/y)\"\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "Fast-forward merge (y => x)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/x &&\n"> <LIT_CHARS "\tgit notes merge y &&\n"> <LIT_CHARS "\ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/y)\"\n">]}  )
  (Pipeline
    (Com {[LIT_CHARS cat]}
      <
      (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [LIT_CHARS "9f506ee70e20379d7f78204c77b334f43d77410d "][VarSub commit_sha3][LIT_CHARS "\n"][LIT_CHARS "23a47d6ea7d589895faf800752054818e1e7627b "][VarSub commit_sha2][LIT_CHARS "\n"][LIT_CHARS "b02d459c32f0e68f2fe0981033bb34f38776ba47 "][VarSub commit_sha1][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
      >
    )
    (Com {[LIT_CHARS sort]}
      <
      (FilenameRedirectNode filename={[LIT_CHARS expect_notes_z]} <REDIR_GREAT ">"> 1),
      >
    )
  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_z]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "notes for commit3\n"][LIT_CHARS "\n"][LIT_CHARS "appended notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "new notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "change some of the initial 5 notes (x -> z)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/z refs/notes/x &&\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/z &&\n"> <LIT_CHARS "\tgit notes add -f -m \"new notes for commit2\" commit2 &&\n"> <LIT_CHARS "\tgit notes append -m \"appended notes for commit3\" commit3 &&\n"> <LIT_CHARS "\tgit notes remove commit4 &&\n"> <LIT_CHARS "\tgit notes remove commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree has no fanout (z)">]} {[SQ <LIT_CHARS "verify_no_fanout z">]}  )
  (Com {[LIT_CHARS cp]} {[LIT_CHARS expect_log_z]} {[LIT_CHARS expect_log_m]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "successful merge without conflicts (y => z)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/z &&\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/m &&\n"> <LIT_CHARS "\tgit notes merge y &&\n"> <LIT_CHARS "\tverify_notes m commit5 &&\n"> <LIT_CHARS "\t# x/y/z unchanged\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_notes y commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_w]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "other notes for commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "other notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "other notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "introduce conflicting changes (y -> w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/w refs/notes/y &&\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/w &&\n"> <LIT_CHARS "\tgit notes add -f -m \"other notes for commit1\" commit1 &&\n"> <LIT_CHARS "\tgit notes add -f -m \"other notes for commit3\" commit3 &&\n"> <LIT_CHARS "\tgit notes add -f -m \"other notes for commit4\" commit4 &&\n"> <LIT_CHARS "\tgit notes remove commit5 &&\n"> <LIT_CHARS "\tverify_notes w commit5\n">]}  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_m]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "other notes for commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "other notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "new notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "other notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "successful merge using \"ours\" strategy (z => w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/w &&\n"> <LIT_CHARS "\tgit config core.notesRef refs/notes/m &&\n"> <LIT_CHARS "\tgit notes merge -s ours z &&\n"> <LIT_CHARS "\tverify_notes m commit5 &&\n"> <LIT_CHARS "\t# w/x/y/z unchanged\n"> <LIT_CHARS "\tverify_notes w commit5 &&\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_notes y commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_m]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "notes for commit3\n"][LIT_CHARS "\n"][LIT_CHARS "appended notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "new notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "other notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "successful merge using \"theirs\" strategy (z => w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/w &&\n"> <LIT_CHARS "\tgit notes merge -s theirs z &&\n"> <LIT_CHARS "\tverify_notes m commit5 &&\n"> <LIT_CHARS "\t# w/x/y/z unchanged\n"> <LIT_CHARS "\tverify_notes w commit5 &&\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_notes y commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_m]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "other notes for commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "other notes for commit3\n"][LIT_CHARS "\n"][LIT_CHARS "notes for commit3\n"][LIT_CHARS "\n"][LIT_CHARS "appended notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "new notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "other notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "successful merge using \"union\" strategy (z => w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/w &&\n"> <LIT_CHARS "\tgit notes merge -s union z &&\n"> <LIT_CHARS "\tverify_notes m commit5 &&\n"> <LIT_CHARS "\t# w/x/y/z unchanged\n"> <LIT_CHARS "\tverify_notes w commit5 &&\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_notes y commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_m]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "other notes for commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "appended notes for commit3\n"][LIT_CHARS "notes for commit3\n"][LIT_CHARS "other notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "new notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "other notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "successful merge using \"cat_sort_uniq\" strategy (z => w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/w &&\n"> <LIT_CHARS "\tgit notes merge -s cat_sort_uniq z &&\n"> <LIT_CHARS "\tverify_notes m commit5 &&\n"> <LIT_CHARS "\t# w/x/y/z unchanged\n"> <LIT_CHARS "\tverify_notes w commit5 &&\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_notes y commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "fails to merge using \"manual\" strategy (z => w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tgit update-ref refs/notes/m refs/notes/w &&\n"> <LIT_CHARS "\ttest_must_fail git notes merge z\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Pipeline
    (Com {[LIT_CHARS cat]}
      <
      (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha3][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
      >
    )
    (Com {[LIT_CHARS sort]}
      <
      (FilenameRedirectNode filename={[LIT_CHARS expect_conflicts]} <REDIR_GREAT ">"> 1),
      >
    )
  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_conflict_] [VarSub commit_sha3]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [LIT_CHARS "<<<<<<< refs/notes/m\n"][LIT_CHARS "other notes for commit3\n"][LIT_CHARS "=======\n"][LIT_CHARS "notes for commit3\n"][LIT_CHARS "\n"][LIT_CHARS "appended notes for commit3\n"][LIT_CHARS ">>>>>>> refs/notes/z\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_conflict_] [VarSub commit_sha4]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [LIT_CHARS "other notes for commit4\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "verify conflict entries (with no fanout)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tls .git/NOTES_MERGE_WORKTREE >output_conflicts &&\n"> <LIT_CHARS "\ttest_cmp expect_conflicts output_conflicts &&\n"> <LIT_CHARS "\t( for f in $(cat expect_conflicts); do\n"> <LIT_CHARS "\t\ttest_cmp \"expect_conflict_$f\" \".git/NOTES_MERGE_WORKTREE/$f\" ||\n"> <LIT_CHARS "\t\texit 1\n"> <LIT_CHARS "\tdone ) &&\n"> <LIT_CHARS "\t# Verify that current notes tree (pre-merge) has not changed (m == w)\n"> <LIT_CHARS "\ttest \"$(git rev-parse refs/notes/m)\" = \"$(git rev-parse refs/notes/w)\"\n">]}  )
  (Com {[LIT_CHARS cat]}
    <
    (FilenameRedirectNode filename={[LIT_CHARS expect_log_m]} <REDIR_GREAT ">"> 1),
    (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [VarSub commit_sha5][LIT_CHARS " commit5\n"][LIT_CHARS "\n"][VarSub commit_sha4][LIT_CHARS " commit4\n"][LIT_CHARS "other notes for commit4\n"][LIT_CHARS "\n"][VarSub commit_sha3][LIT_CHARS " commit3\n"][LIT_CHARS "other notes for commit3\n"][LIT_CHARS "\n"][LIT_CHARS "appended notes for commit3\n"][LIT_CHARS "\n"][VarSub commit_sha2][LIT_CHARS " commit2\n"][LIT_CHARS "new notes for commit2\n"][LIT_CHARS "\n"][VarSub commit_sha1][LIT_CHARS " commit1\n"][LIT_CHARS "other notes for commit1\n"][LIT_CHARS "\n"]]} <REDIR_DLESS "<<"> 0),
    >
  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "resolve and finalize merge (z => w)">]} {[SQ <LIT_CHARS "\n"> <LIT_CHARS "\tcat >.git/NOTES_MERGE_WORKTREE/$commit_sha3 <<EOF &&\n"> <LIT_CHARS "other notes for commit3\n"> <LIT_CHARS "\n"> <LIT_CHARS "appended notes for commit3\n"> <LIT_CHARS "EOF\n"> <LIT_CHARS "\tgit notes merge --commit &&\n"> <LIT_CHARS "\tverify_notes m commit5 &&\n"> <LIT_CHARS "\t# w/x/y/z unchanged\n"> <LIT_CHARS "\tverify_notes w commit5 &&\n"> <LIT_CHARS "\tverify_notes x commit5 &&\n"> <LIT_CHARS "\tverify_notes y commit5 &&\n"> <LIT_CHARS "\tverify_notes z commit5\n">]}  )
  (Com {[LIT_CHARS test_expect_success]} {[SQ <LIT_CHARS "notes tree still has fanout after merge (m)">]} {[SQ <LIT_CHARS "verify_fanout m">]}  )
  (Com {[LIT_CHARS test_done]}  )
)