(command.CommandList children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:test_description) op: Equal rhs: {(SQ <'Test notes merging at various fanout levels'>)} ) ] ) (C {(.)} {(./test-lib.sh)}) (command.FuncDef name: verify_notes body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:notes_ref) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commit) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} ) ] ) (command.AndOr ops: [Op_DAmp Op_DAmp] children: [ (command.If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ (expect_notes_) ($ VSub_DollarName '$notes_ref'))})] action: [ (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (command.Pipeline children: [ (C {(git)} {(-c)} {(core.notesRef) (Lit_Other '=') (DQ (refs/notes/) ($ VSub_DollarName '$notes_ref')) } {(notes)} ) (command.SimpleCommand words: [{(sort)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ (output_notes_) ($ VSub_DollarName '$notes_ref'))} ) ] ) ] negated: F ) (C {(test_cmp)} {(DQ (expect_notes_) ($ VSub_DollarName '$notes_ref'))} {(DQ (output_notes_) ($ VSub_DollarName '$notes_ref'))} ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) (command.SimpleCommand words: [ {(git)} {(-c)} {(core.notesRef) (Lit_Other '=') (DQ (refs/notes/) ($ VSub_DollarName '$notes_ref')) } {(log)} {(--format) (Lit_Other '=') (DQ ('%H %s%n%N'))} {(DQ ($ VSub_DollarName '$commit'))} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(DQ (output_log_) ($ VSub_DollarName '$notes_ref'))} ) ] ) (C {(test_cmp)} {(DQ (expect_log_) ($ VSub_DollarName '$notes_ref'))} {(DQ (output_log_) ($ VSub_DollarName '$notes_ref'))} ) ] ) ] ) ) (command.FuncDef name: verify_fanout body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:notes_ref) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [ {(git)} {(rev-parse)} {(--quiet)} {(--verify)} {(DQ (refs/notes/) ($ VSub_DollarName '$notes_ref'))} ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (command.Pipeline children: [ (C {(git)} {(ls-tree)} {(-r)} {(--name-only)} {(DQ (refs/notes/) ($ VSub_DollarName '$notes_ref'))} ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(path)})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$path'))} arms: [ (case_arm pat_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 '?') } ] action: [(C {(Lit_Other ':')} {(true)})] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(echo)} { (DQ ('Invalid path ') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ($ VSub_DollarName '$path') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ] ) ) ] negated: F ) ] ) ] ) ) (command.FuncDef name: verify_no_fanout body: (command.BraceGroup children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:notes_ref) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.SimpleCommand words: [ {(git)} {(rev-parse)} {(--quiet)} {(--verify)} {(DQ (refs/notes/) ($ VSub_DollarName '$notes_ref'))} ] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)})] ) (command.Pipeline children: [ (C {(git)} {(ls-tree)} {(-r)} {(--name-only)} {(DQ (refs/notes/) ($ VSub_DollarName '$notes_ref'))} ) (command.WhileUntil keyword: <KW_While while> cond: [(C {(read)} {(path)})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$path'))} arms: [ (case_arm pat_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 '?') } ] action: [(C {(Lit_Other ':')} {(true)})] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(echo)} { (DQ ('Invalid path ') (word_part.EscapedLiteralPart token: <Lit_EscapedChar '\\"'> ) ($ VSub_DollarName '$path') (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\"'>) ) } ) (command.ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] ) ] ) ] ) ] ) ) ] negated: F ) ] ) ] ) ) (C {(test_expect_success)} {(SQ <'setup a few initial commits with notes (notes ref: x)'>)} { (SQ <'\n'> <'\tgit config core.notesRef refs/notes/x &&\n'> <'\tfor i in 1 2 3 4 5\n'> <'\tdo\n'> <'\t\ttest_commit "commit$i" >/dev/null &&\n'> <'\t\tgit notes add -m "notes for commit$i" || return 1\n'> <'\tdone\n'> ) } ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commit_sha1) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(commit1) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}')} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commit_sha2) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(commit2) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}')} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commit_sha3) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(commit3) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}')} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commit_sha4) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(commit4) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}')} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:commit_sha5) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(git)} {(rev-parse)} {(commit5) (Lit_Other '^') (Lit_LBrace '{') (commit) (Lit_RBrace '}')} ) ] ) left_token: <Left_CommandSub '$('> ) } ) ] ) (command.Pipeline children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 585 stdin_parts: [ ('aed91155c7a72c2188e781fdf40e0f3761b299db ') ($ VSub_DollarName '$commit_sha5') ('\n') ('99fab268f9d7ee7b011e091a436c78def8eeee69 ') ($ VSub_DollarName '$commit_sha4') ('\n') ('953c20ae26c7aa0b428c20693fe38bc687f9d1a9 ') ($ VSub_DollarName '$commit_sha3') ('\n') ('6358796131b8916eaa2dde6902642942a1cb37e1 ') ($ VSub_DollarName '$commit_sha2') ('\n') ('b02d459c32f0e68f2fe0981033bb34f38776ba47 ') ($ VSub_DollarName '$commit_sha1') ('\n') ] ) ] ) (command.SimpleCommand words: [{(sort)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_notes_x)})] ) ] negated: F ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_x)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 616 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('notes for commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('notes for commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'sanity check (x)'>)} {(SQ <'\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_no_fanout x\n'>)} ) (command.Assignment keyword: Assign_None pairs: [(assign_pair lhs:(lhs_expr.LhsName name:num) op:Equal rhs:{(300)})] ) (C {(cp)} {(expect_log_x)} {(expect_log_y)}) (C {(test_expect_success)} {(SQ <'Add a few hundred commits w/notes to trigger fanout (x -> y)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/y refs/notes/x &&\n'> <'\tgit config core.notesRef refs/notes/y &&\n'> <'\ti=5 &&\n'> <'\twhile test $i -lt $num\n'> <'\tdo\n'> <'\t\ti=$(($i + 1)) &&\n'> <'\t\ttest_commit "commit$i" >/dev/null &&\n'> <'\t\tgit notes add -m "notes for commit$i" || return 1\n'> <'\tdone &&\n'> <'\ttest "$(git rev-parse refs/notes/y)" != "$(git rev-parse refs/notes/x)" &&\n'> <'\t# Expected number of commits and notes\n'> <'\ttest $(git rev-list HEAD | wc -l) = $num &&\n'> <'\ttest $(git notes list | wc -l) = $num &&\n'> <'\t# 5 first notes unchanged\n'> <'\tverify_notes y commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree has fanout (y)'>)} {(SQ <'verify_fanout y'>)}) (C {(test_expect_success)} {(SQ <'No-op merge (already included) (x => y)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/y &&\n'> <'\tgit config core.notesRef refs/notes/m &&\n'> <'\tgit notes merge x &&\n'> <'\ttest "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/y)"\n'> ) } ) (C {(test_expect_success)} {(SQ <'Fast-forward merge (y => x)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/x &&\n'> <'\tgit notes merge y &&\n'> <'\ttest "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/y)"\n'> ) } ) (command.Pipeline children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 730 stdin_parts: [ ('9f506ee70e20379d7f78204c77b334f43d77410d ') ($ VSub_DollarName '$commit_sha3') ('\n') ('23a47d6ea7d589895faf800752054818e1e7627b ') ($ VSub_DollarName '$commit_sha2') ('\n') ('b02d459c32f0e68f2fe0981033bb34f38776ba47 ') ($ VSub_DollarName '$commit_sha1') ('\n') ] ) ] ) (command.SimpleCommand words: [{(sort)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_notes_z)})] ) ] negated: F ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_z)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 761 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('notes for commit3\n') ('\n') ('appended notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('new notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'change some of the initial 5 notes (x -> z)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/z refs/notes/x &&\n'> <'\tgit config core.notesRef refs/notes/z &&\n'> <'\tgit notes add -f -m "new notes for commit2" commit2 &&\n'> <'\tgit notes append -m "appended notes for commit3" commit3 &&\n'> <'\tgit notes remove commit4 &&\n'> <'\tgit notes remove commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree has no fanout (z)'>)} {(SQ <'verify_no_fanout z'>)}) (C {(cp)} {(expect_log_z)} {(expect_log_m)}) (C {(test_expect_success)} {(SQ <'successful merge without conflicts (y => z)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/z &&\n'> <'\tgit config core.notesRef refs/notes/m &&\n'> <'\tgit notes merge y &&\n'> <'\tverify_notes m commit5 &&\n'> <'\t# x/y/z unchanged\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_notes y commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_w)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 857 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('other notes for commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('other notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('other notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'introduce conflicting changes (y -> w)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/w refs/notes/y &&\n'> <'\tgit config core.notesRef refs/notes/w &&\n'> <'\tgit notes add -f -m "other notes for commit1" commit1 &&\n'> <'\tgit notes add -f -m "other notes for commit3" commit3 &&\n'> <'\tgit notes add -f -m "other notes for commit4" commit4 &&\n'> <'\tgit notes remove commit5 &&\n'> <'\tverify_notes w commit5\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_m)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 905 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('other notes for commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('other notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('new notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('other notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'successful merge using "ours" strategy (z => w)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/w &&\n'> <'\tgit config core.notesRef refs/notes/m &&\n'> <'\tgit notes merge -s ours z &&\n'> <'\tverify_notes m commit5 &&\n'> <'\t# w/x/y/z unchanged\n'> <'\tverify_notes w commit5 &&\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_notes y commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_m)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 967 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('notes for commit3\n') ('\n') ('appended notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('new notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('other notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'successful merge using "theirs" strategy (z => w)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/w &&\n'> <'\tgit notes merge -s theirs z &&\n'> <'\tverify_notes m commit5 &&\n'> <'\t# w/x/y/z unchanged\n'> <'\tverify_notes w commit5 &&\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_notes y commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_m)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1031 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('other notes for commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('other notes for commit3\n') ('\n') ('notes for commit3\n') ('\n') ('appended notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('new notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('other notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'successful merge using "union" strategy (z => w)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/w &&\n'> <'\tgit notes merge -s union z &&\n'> <'\tverify_notes m commit5 &&\n'> <'\t# w/x/y/z unchanged\n'> <'\tverify_notes w commit5 &&\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_notes y commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_m)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1093 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('other notes for commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('appended notes for commit3\n') ('notes for commit3\n') ('other notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('new notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('other notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'successful merge using "cat_sort_uniq" strategy (z => w)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/w &&\n'> <'\tgit notes merge -s cat_sort_uniq z &&\n'> <'\tverify_notes m commit5 &&\n'> <'\t# w/x/y/z unchanged\n'> <'\tverify_notes w commit5 &&\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_notes y commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (C {(test_expect_success)} {(SQ <'fails to merge using "manual" strategy (z => w)'>)} { (SQ <'\n'> <'\tgit update-ref refs/notes/m refs/notes/w &&\n'> <'\ttest_must_fail git notes merge z\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (command.Pipeline children: [ (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1194 stdin_parts: [ ($ VSub_DollarName '$commit_sha3') ('\n') ($ VSub_DollarName '$commit_sha4') ('\n') ] ) ] ) (command.SimpleCommand words: [{(sort)}] redirects: [(redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_conflicts)})] ) ] negated: F ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expect_conflict_) ($ VSub_DollarName '$commit_sha3')} ) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1213 stdin_parts: [ ('<<<<<<< refs/notes/m\n') ('other notes for commit3\n') ('=======\n') ('notes for commit3\n') ('\n') ('appended notes for commit3\n') ('>>>>>>> refs/notes/z\n') ] ) ] ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(expect_conflict_) ($ VSub_DollarName '$commit_sha4')} ) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1226 stdin_parts: [('other notes for commit4\n')] ) ] ) (C {(test_expect_success)} {(SQ <'verify conflict entries (with no fanout)'>)} { (SQ <'\n'> <'\tls .git/NOTES_MERGE_WORKTREE >output_conflicts &&\n'> <'\ttest_cmp expect_conflicts output_conflicts &&\n'> <'\t( for f in $(cat expect_conflicts); do\n'> <'\t\ttest_cmp "expect_conflict_$f" ".git/NOTES_MERGE_WORKTREE/$f" ||\n'> <'\t\texit 1\n'> <'\tdone ) &&\n'> <'\t# Verify that current notes tree (pre-merge) has not changed (m == w)\n'> <'\ttest "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)"\n'> ) } ) (command.SimpleCommand words: [{(cat)}] redirects: [ (redir.Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(expect_log_m)}) (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1277 stdin_parts: [ ($ VSub_DollarName '$commit_sha5') (' commit5\n') ('\n') ($ VSub_DollarName '$commit_sha4') (' commit4\n') ('other notes for commit4\n') ('\n') ($ VSub_DollarName '$commit_sha3') (' commit3\n') ('other notes for commit3\n') ('\n') ('appended notes for commit3\n') ('\n') ($ VSub_DollarName '$commit_sha2') (' commit2\n') ('new notes for commit2\n') ('\n') ($ VSub_DollarName '$commit_sha1') (' commit1\n') ('other notes for commit1\n') ('\n') ] ) ] ) (C {(test_expect_success)} {(SQ <'resolve and finalize merge (z => w)'>)} { (SQ <'\n'> <'\tcat >.git/NOTES_MERGE_WORKTREE/$commit_sha3 <<EOF &&\n'> <'other notes for commit3\n'> <'\n'> <'appended notes for commit3\n'> <'EOF\n'> <'\tgit notes merge --commit &&\n'> <'\tverify_notes m commit5 &&\n'> <'\t# w/x/y/z unchanged\n'> <'\tverify_notes w commit5 &&\n'> <'\tverify_notes x commit5 &&\n'> <'\tverify_notes y commit5 &&\n'> <'\tverify_notes z commit5\n'> ) } ) (C {(test_expect_success)} {(SQ <'notes tree still has fanout after merge (m)'>)} {(SQ <'verify_fanout m'>)} ) (C {(test_done)}) ] )