(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:test_description) op: assign_op.Equal rhs: {(SQ (Token id:Id.Lit_Chars val:'Test commit notes' span_id:15))} spids: [13] ) ] ) (C {(.)} {(./test-lib.sh)}) (command.Simple words: [{(write_script)} {(fake_editor)}] redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:28) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:29)) (OF)} here_end_span_id: 34 stdin_parts: [('echo "$MSG" >"$1"\n') ('echo "$MSG" >&2\n')] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:GIT_EDITOR) op: assign_op.Equal rhs: {(./fake_editor)} spids: [35] ) ] ) (C {(export)} {(GIT_EDITOR)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:indent) op: assign_op.Equal rhs: {(DQ (' '))} spids: [43] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cannot annotate non-existing HEAD' span_id:52))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:56) (Token id: Id.Lit_Chars val: '\ttest_must_fail env MSG=3 git notes add\n' span_id: 57 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:setup span_id:64))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:68) (Token id:Id.Lit_Chars val:'\ttest_commit 1st &&\n' span_id:69) (Token id:Id.Lit_Chars val:'\ttest_commit 2nd\n' span_id:70) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'need valid notes ref' span_id:77))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:81) (Token id: Id.Lit_Chars val: '\ttest_must_fail env MSG=1 GIT_NOTES_REF=/ git notes show &&\n' span_id: 82 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail env MSG=2 GIT_NOTES_REF=/ git notes show\n' span_id:83) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'refusing to add notes in refs/heads/' span_id:90))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:94) (Token id: Id.Lit_Chars val: '\ttest_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add\n' span_id: 95 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'refusing to edit notes in refs/remotes/' span_id:102))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:106) (Token id: Id.Lit_Chars val: '\ttest_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes edit\n' span_id: 107 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'handle empty notes gracefully' span_id:117))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:121) (Token id:Id.Lit_Chars val:'\ttest_expect_code 1 git notes show\n' span_id:122) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show non-existent notes entry with %N' span_id:129))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:133) (Token id:Id.Lit_Chars val:'\ttest_write_lines A B >expect &&\n' span_id:134) (Token id:Id.Lit_Chars val:'\tgit show -s --format="A%n%NB" >actual &&\n' span_id:135) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:136) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create notes' span_id:143))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:147) (Token id:Id.Lit_Chars val:'\tMSG=b4 git notes add &&\n' span_id:148) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/NOTES_EDITMSG &&\n' span_id:149) (Token id: Id.Lit_Chars val: '\tgit ls-tree -r refs/notes/commits >actual &&\n' span_id: 150 ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 1 actual &&\n' span_id:151) (Token id:Id.Lit_Chars val:'\ttest "b4" = "$(git notes show)" &&\n' span_id:152) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ &&\n' span_id:153) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:154) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show notes entry with %N' span_id:161))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:165) (Token id:Id.Lit_Chars val:'\ttest_write_lines A b4 B >expect &&\n' span_id:166) (Token id:Id.Lit_Chars val:'\tgit show -s --format="A%n%NB" >actual &&\n' span_id:167) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:168) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create reflog entry' span_id:175))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:179) (Token id:Id.Lit_Chars val:'\tcat <<-EOF >expect &&\n' span_id:180) (Token id:Id.Lit_Chars val:'\t\ta1d8fa6 refs/notes/commits@{0}: notes: Notes added by ' span_id:181) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:183)) (SQ (Token id:Id.Lit_Chars val:'git notes add' span_id:185)) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:"\\'" span_id:187)) (SQ (Token id:Id.Lit_Chars val:'\n' span_id:189) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:190) (Token id:Id.Lit_Chars val:'\tgit reflog show refs/notes/commits >actual &&\n' span_id:191) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:192) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'edit existing notes' span_id:199))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:203) (Token id:Id.Lit_Chars val:'\tMSG=b3 git notes edit &&\n' span_id:204) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/NOTES_EDITMSG &&\n' span_id:205) (Token id: Id.Lit_Chars val: '\tgit ls-tree -r refs/notes/commits >actual &&\n' span_id: 206 ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 1 actual &&\n' span_id:207) (Token id:Id.Lit_Chars val:'\ttest "b3" = "$(git notes show)" &&\n' span_id:208) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ &&\n' span_id:209) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:210) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show notes from treeish' span_id:217))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:221) (Token id: Id.Lit_Chars val: '\ttest "b3" = "$(git notes --ref commits^{tree} show)" &&\n' span_id: 222 ) (Token id:Id.Lit_Chars val:'\ttest "b4" = "$(git notes --ref commits@{1} show)"\n' span_id:223) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cannot edit notes from non-ref' span_id:230))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:234) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes --ref commits^{tree} edit &&\n' span_id: 235 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes --ref commits@{1} edit\n' span_id:236) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'cannot "git notes add -m" where notes already exists' span_id: 243 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:247) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes add -m "b2" &&\n' span_id: 248 ) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/NOTES_EDITMSG &&\n' span_id:249) (Token id: Id.Lit_Chars val: '\tgit ls-tree -r refs/notes/commits >actual &&\n' span_id: 250 ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 1 actual &&\n' span_id:251) (Token id:Id.Lit_Chars val:'\ttest "b3" = "$(git notes show)" &&\n' span_id:252) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ &&\n' span_id:253) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:254) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'can overwrite existing note with "git notes add -f -m"' span_id: 261 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:265) (Token id:Id.Lit_Chars val:'\tgit notes add -f -m "b1" &&\n' span_id:266) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/NOTES_EDITMSG &&\n' span_id:267) (Token id: Id.Lit_Chars val: '\tgit ls-tree -r refs/notes/commits >actual &&\n' span_id: 268 ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 1 actual &&\n' span_id:269) (Token id:Id.Lit_Chars val:'\ttest "b1" = "$(git notes show)" &&\n' span_id:270) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ &&\n' span_id:271) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:272) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'add w/no options on existing note morphs into edit' span_id: 279 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:283) (Token id:Id.Lit_Chars val:'\tMSG=b2 git notes add &&\n' span_id:284) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/NOTES_EDITMSG &&\n' span_id:285) (Token id: Id.Lit_Chars val: '\tgit ls-tree -r refs/notes/commits >actual &&\n' span_id: 286 ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 1 actual &&\n' span_id:287) (Token id:Id.Lit_Chars val:'\ttest "b2" = "$(git notes show)" &&\n' span_id:288) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ &&\n' span_id:289) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:290) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'can overwrite existing note with "git notes add -f"' span_id: 297 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:301) (Token id:Id.Lit_Chars val:'\tMSG=b1 git notes add -f &&\n' span_id:302) (Token id:Id.Lit_Chars val:'\ttest_path_is_missing .git/NOTES_EDITMSG &&\n' span_id:303) (Token id: Id.Lit_Chars val: '\tgit ls-tree -r refs/notes/commits >actual &&\n' span_id: 304 ) (Token id:Id.Lit_Chars val:'\ttest_line_count = 1 actual &&\n' span_id:305) (Token id:Id.Lit_Chars val:'\ttest "b1" = "$(git notes show)" &&\n' span_id:306) (Token id:Id.Lit_Chars val:'\tgit show HEAD^ &&\n' span_id:307) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:308) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show notes' span_id:315))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:319) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:320) (Token id:Id.Lit_Chars val:'\t\tcommit 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n' span_id:321) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 322 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:14:13 2005 -0700\n' span_id:323) (Token id:Id.Lit_Chars val:'\n' span_id:324) (Token id:Id.Lit_Chars val:'\t\t${indent}2nd\n' span_id:325) (Token id:Id.Lit_Chars val:'\n' span_id:326) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:327) (Token id:Id.Lit_Chars val:'\t\t${indent}b1\n' span_id:328) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:329) (Token id: Id.Lit_Chars val: '\t! (git cat-file commit HEAD | grep b1) &&\n' span_id: 330 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:331) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:332) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show multi-line notes' span_id:339))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:343) (Token id:Id.Lit_Chars val:'\ttest_commit 3rd &&\n' span_id:344) (Token id:Id.Lit_Chars val:'\tMSG="b3${LF}c3c3c3c3${LF}d3d3d3" git notes add &&\n' span_id:345) (Token id:Id.Lit_Chars val:'\tcat >expect-multiline <<-EOF &&\n' span_id:346) (Token id:Id.Lit_Chars val:'\t\tcommit d07d62e5208f22eb5695e7eb47667dc8b9860290\n' span_id:347) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 348 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:15:13 2005 -0700\n' span_id:349) (Token id:Id.Lit_Chars val:'\n' span_id:350) (Token id:Id.Lit_Chars val:'\t\t${indent}3rd\n' span_id:351) (Token id:Id.Lit_Chars val:'\n' span_id:352) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:353) (Token id:Id.Lit_Chars val:'\t\t${indent}b3\n' span_id:354) (Token id:Id.Lit_Chars val:'\t\t${indent}c3c3c3c3\n' span_id:355) (Token id:Id.Lit_Chars val:'\t\t${indent}d3d3d3\n' span_id:356) (Token id:Id.Lit_Chars val:'\n' span_id:357) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:358) (Token id:Id.Lit_Chars val:'\tcat expect >>expect-multiline &&\n' span_id:359) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:360) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-multiline actual\n' span_id:361) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show -F notes' span_id:368))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:372) (Token id:Id.Lit_Chars val:'\ttest_commit 4th &&\n' span_id:373) (Token id:Id.Lit_Chars val:'\techo "xyzzy" >note5 &&\n' span_id:374) (Token id:Id.Lit_Chars val:'\tgit notes add -F note5 &&\n' span_id:375) (Token id:Id.Lit_Chars val:'\tcat >expect-F <<-EOF &&\n' span_id:376) (Token id: Id.Lit_Chars val: '\t\tcommit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n' span_id: 377 ) (Token id:Id.Lit_Chars val:'\t\tAuthor: A U Thor <author@example.com>\n' span_id:378) (Token id: Id.Lit_Chars val: '\t\tDate: Thu Apr 7 15:16:13 2005 -0700\n' span_id: 379 ) (Token id:Id.Lit_Chars val:'\n' span_id:380) (Token id:Id.Lit_Chars val:'\t\t${indent}4th\n' span_id:381) (Token id:Id.Lit_Chars val:'\n' span_id:382) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:383) (Token id:Id.Lit_Chars val:'\t\t${indent}xyzzy\n' span_id:384) (Token id:Id.Lit_Chars val:'\n' span_id:385) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:386) (Token id:Id.Lit_Chars val:'\tcat expect-multiline >>expect-F &&\n' span_id:387) (Token id:Id.Lit_Chars val:'\tgit log -3 >actual &&\n' span_id:388) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-F actual\n' span_id:389) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'Re-adding -F notes without -f fails' span_id:396))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:400) (Token id:Id.Lit_Chars val:'\techo "zyxxy" >note5 &&\n' span_id:401) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes add -F note5 &&\n' span_id:402) (Token id:Id.Lit_Chars val:'\tgit log -3 >actual &&\n' span_id:403) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-F actual\n' span_id:404) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --pretty=raw does not show notes' span_id:411))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:415) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:416) (Token id:Id.Lit_Chars val:'\t\tcommit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n' span_id:417) (Token id: Id.Lit_Chars val: '\t\ttree 05ac65288c4c4b3b709a020ae94b2ece2f2201ae\n' span_id: 418 ) (Token id:Id.Lit_Chars val:'\t\tparent d07d62e5208f22eb5695e7eb47667dc8b9860290\n' span_id:419) (Token id: Id.Lit_Chars val: '\t\tauthor A U Thor <author@example.com> 1112912173 -0700\n' span_id: 420 ) (Token id: Id.Lit_Chars val: '\t\tcommitter C O Mitter <committer@example.com> 1112912173 -0700\n' span_id: 421 ) (Token id:Id.Lit_Chars val:'\n' span_id:422) (Token id:Id.Lit_Chars val:'\t\t${indent}4th\n' span_id:423) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:424) (Token id:Id.Lit_Chars val:'\tgit log -1 --pretty=raw >actual &&\n' span_id:425) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:426) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --show-notes' span_id:433))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:437) (Token id:Id.Lit_Chars val:'\tcat >>expect <<-EOF &&\n' span_id:438) (Token id:Id.Lit_Chars val:'\n' span_id:439) (Token id:Id.Lit_Chars val:'\tNotes:\n' span_id:440) (Token id:Id.Lit_Chars val:'\t${indent}xyzzy\n' span_id:441) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:442) (Token id: Id.Lit_Chars val: '\tgit log -1 --pretty=raw --show-notes >actual &&\n' span_id: 443 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:444) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --no-notes' span_id:451))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:455) (Token id:Id.Lit_Chars val:'\tgit log -1 --no-notes >actual &&\n' span_id:456) (Token id:Id.Lit_Chars val:'\t! grep xyzzy actual\n' span_id:457) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git format-patch does not show notes' span_id:464))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:468) (Token id: Id.Lit_Chars val: '\tgit format-patch -1 --stdout >actual &&\n' span_id: 469 ) (Token id:Id.Lit_Chars val:'\t! grep xyzzy actual\n' span_id:470) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git format-patch --show-notes does show notes' span_id:477))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:481) (Token id: Id.Lit_Chars val: '\tgit format-patch --show-notes -1 --stdout >actual &&\n' span_id: 482 ) (Token id:Id.Lit_Chars val:'\tgrep xyzzy actual\n' span_id:483) ) } ) (command.ForEach iter_name: pretty iter_words: [ {(DQ )} {(--pretty)} {(--pretty) (Id.Lit_Equals '=') (raw)} {(--pretty) (Id.Lit_Equals '=') (short)} {(--pretty) (Id.Lit_Equals '=') (medium)} {(--pretty) (Id.Lit_Equals '=') (full)} {(--pretty) (Id.Lit_Equals '=') (fuller)} {(--pretty) (Id.Lit_Equals '=') (format) (Id.Lit_Other ':') (Id.Lit_Other '%') (s)} {(--oneline)} ] do_arg_iter: F body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$pretty'))} arms: [ (case_arm pat_list: [{(DQ )}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:p) op: assign_op.Equal rhs: (word.Empty) spids: [547] ) (assign_pair lhs: (sh_lhs_expr.Name name:not) op: assign_op.Equal rhs: (word.Empty) spids: [549] ) (assign_pair lhs: (sh_lhs_expr.Name name:negate) op: assign_op.Equal rhs: {(DQ )} spids: [551] ) ] ) ] spids: [543 545 555 -1] ) (case_arm pat_list: [{(Id.Lit_QMark '?') (Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:p) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$pretty'))} spids: [562] ) (assign_pair lhs: (sh_lhs_expr.Name name:not) op: assign_op.Equal rhs: {(DQ (' not'))} spids: [567] ) (assign_pair lhs: (sh_lhs_expr.Name name:negate) op: assign_op.Equal rhs: {(DQ ('!'))} spids: [572] ) ] ) ] spids: [558 560 577 -1] ) ] ) (C {(test_expect_success)} { (DQ ('git show ') ($ Id.VSub_DollarName '$pretty') (' does') ($ Id.VSub_DollarName '$not') (' show notes') ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:594) (Token id: Id.Lit_Chars val: '\t\tgit show $p >actual &&\n' span_id: 595 ) (Token id:Id.Lit_Chars val:'\t\teval "$negate grep xyzzy actual"\n' span_id:596) (Token id:Id.Lit_Chars val:'\t' span_id:597) ) } ) ] ) ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup alternate notes ref' span_id:606))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:610) (Token id: Id.Lit_Chars val: '\tgit notes --ref=alternate add -m alternate\n' span_id: 611 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --notes shows default notes' span_id:618))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:622) (Token id:Id.Lit_Chars val:'\tgit log -1 --notes >actual &&\n' span_id:623) (Token id:Id.Lit_Chars val:'\tgrep xyzzy actual &&\n' span_id:624) (Token id:Id.Lit_Chars val:'\t! grep alternate actual\n' span_id:625) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --notes=X shows only X' span_id:632))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:636) (Token id: Id.Lit_Chars val: '\tgit log -1 --notes=alternate >actual &&\n' span_id: 637 ) (Token id:Id.Lit_Chars val:'\t! grep xyzzy actual &&\n' span_id:638) (Token id:Id.Lit_Chars val:'\tgrep alternate actual\n' span_id:639) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --notes --notes=X shows both' span_id:646))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:650) (Token id: Id.Lit_Chars val: '\tgit log -1 --notes --notes=alternate >actual &&\n' span_id: 651 ) (Token id:Id.Lit_Chars val:'\tgrep xyzzy actual &&\n' span_id:652) (Token id:Id.Lit_Chars val:'\tgrep alternate actual\n' span_id:653) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --no-notes resets default state' span_id:660))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:664) (Token id: Id.Lit_Chars val: '\tgit log -1 --notes --notes=alternate \\\n' span_id: 665 ) (Token id:Id.Lit_Chars val:'\t\t--no-notes --notes=alternate \\\n' span_id:666) (Token id:Id.Lit_Chars val:'\t\t>actual &&\n' span_id:667) (Token id:Id.Lit_Chars val:'\t! grep xyzzy actual &&\n' span_id:668) (Token id:Id.Lit_Chars val:'\tgrep alternate actual\n' span_id:669) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git log --no-notes resets ref list' span_id:676))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:680) (Token id: Id.Lit_Chars val: '\tgit log -1 --notes --notes=alternate \\\n' span_id: 681 ) (Token id:Id.Lit_Chars val:'\t\t--no-notes --notes \\\n' span_id:682) (Token id:Id.Lit_Chars val:'\t\t>actual &&\n' span_id:683) (Token id:Id.Lit_Chars val:'\tgrep xyzzy actual &&\n' span_id:684) (Token id:Id.Lit_Chars val:'\t! grep alternate actual\n' span_id:685) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'show -m notes' span_id:692))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:696) (Token id:Id.Lit_Chars val:'\ttest_commit 5th &&\n' span_id:697) (Token id:Id.Lit_Chars val:'\tgit notes add -m spam -m "foo${LF}bar${LF}baz" &&\n' span_id:698) (Token id:Id.Lit_Chars val:'\tcat >expect-m <<-EOF &&\n' span_id:699) (Token id:Id.Lit_Chars val:'\t\tcommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n' span_id:700) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 701 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:17:13 2005 -0700\n' span_id:702) (Token id:Id.Lit_Chars val:'\n' span_id:703) (Token id:Id.Lit_Chars val:'\t\t${indent}5th\n' span_id:704) (Token id:Id.Lit_Chars val:'\n' span_id:705) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:706) (Token id:Id.Lit_Chars val:'\t\t${indent}spam\n' span_id:707) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:708) (Token id:Id.Lit_Chars val:'\t\t${indent}foo\n' span_id:709) (Token id:Id.Lit_Chars val:'\t\t${indent}bar\n' span_id:710) (Token id:Id.Lit_Chars val:'\t\t${indent}baz\n' span_id:711) (Token id:Id.Lit_Chars val:'\n' span_id:712) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:713) (Token id:Id.Lit_Chars val:'\tcat expect-F >>expect-m &&\n' span_id:714) (Token id:Id.Lit_Chars val:'\tgit log -4 >actual &&\n' span_id:715) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-m actual\n' span_id:716) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'remove note with add -f -F /dev/null' span_id:723))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:727) (Token id:Id.Lit_Chars val:'\tgit notes add -f -F /dev/null &&\n' span_id:728) (Token id:Id.Lit_Chars val:'\tcat >expect-rm-F <<-EOF &&\n' span_id:729) (Token id: Id.Lit_Chars val: '\t\tcommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n' span_id: 730 ) (Token id:Id.Lit_Chars val:'\t\tAuthor: A U Thor <author@example.com>\n' span_id:731) (Token id: Id.Lit_Chars val: '\t\tDate: Thu Apr 7 15:17:13 2005 -0700\n' span_id: 732 ) (Token id:Id.Lit_Chars val:'\n' span_id:733) (Token id:Id.Lit_Chars val:'\t\t${indent}5th\n' span_id:734) (Token id:Id.Lit_Chars val:'\n' span_id:735) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:736) (Token id:Id.Lit_Chars val:'\tcat expect-F >>expect-rm-F &&\n' span_id:737) (Token id:Id.Lit_Chars val:'\tgit log -4 >actual &&\n' span_id:738) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-rm-F actual &&\n' span_id:739) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show\n' span_id:740) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'do not create empty note with -m ""' span_id:747))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:751) (Token id:Id.Lit_Chars val:'\tgit notes add -m "" &&\n' span_id:752) (Token id:Id.Lit_Chars val:'\tgit log -4 >actual &&\n' span_id:753) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-rm-F actual &&\n' span_id:754) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show\n' span_id:755) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'create note with combination of -m and -F' span_id:762))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:766) (Token id: Id.Lit_Chars val: '\tcat >expect-combine_m_and_F <<-EOF &&\n' span_id: 767 ) (Token id:Id.Lit_Chars val:'\t\tfoo\n' span_id:768) (Token id:Id.Lit_Chars val:'\n' span_id:769) (Token id:Id.Lit_Chars val:'\t\txyzzy\n' span_id:770) (Token id:Id.Lit_Chars val:'\n' span_id:771) (Token id:Id.Lit_Chars val:'\t\tbar\n' span_id:772) (Token id:Id.Lit_Chars val:'\n' span_id:773) (Token id:Id.Lit_Chars val:'\t\tzyxxy\n' span_id:774) (Token id:Id.Lit_Chars val:'\n' span_id:775) (Token id:Id.Lit_Chars val:'\t\tbaz\n' span_id:776) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:777) (Token id:Id.Lit_Chars val:'\techo "xyzzy" >note_a &&\n' span_id:778) (Token id:Id.Lit_Chars val:'\techo "zyxxy" >note_b &&\n' span_id:779) (Token id: Id.Lit_Chars val: '\tgit notes add -m "foo" -F note_a -m "bar" -F note_b -m "baz" &&\n' span_id: 780 ) (Token id:Id.Lit_Chars val:'\tgit notes show >actual &&\n' span_id:781) (Token id: Id.Lit_Chars val: '\ttest_cmp expect-combine_m_and_F actual\n' span_id: 782 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'remove note with "git notes remove"' span_id:789))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:793) (Token id:Id.Lit_Chars val:'\tgit notes remove HEAD^ &&\n' span_id:794) (Token id:Id.Lit_Chars val:'\tgit notes remove &&\n' span_id:795) (Token id:Id.Lit_Chars val:'\tcat >expect-rm-remove <<-EOF &&\n' span_id:796) (Token id:Id.Lit_Chars val:'\t\tcommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n' span_id:797) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 798 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:17:13 2005 -0700\n' span_id:799) (Token id:Id.Lit_Chars val:'\n' span_id:800) (Token id:Id.Lit_Chars val:'\t\t${indent}5th\n' span_id:801) (Token id:Id.Lit_Chars val:'\n' span_id:802) (Token id:Id.Lit_Chars val:'\t\tcommit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n' span_id:803) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 804 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:16:13 2005 -0700\n' span_id:805) (Token id:Id.Lit_Chars val:'\n' span_id:806) (Token id:Id.Lit_Chars val:'\t\t${indent}4th\n' span_id:807) (Token id:Id.Lit_Chars val:'\n' span_id:808) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:809) (Token id: Id.Lit_Chars val: '\tcat expect-multiline >>expect-rm-remove &&\n' span_id: 810 ) (Token id:Id.Lit_Chars val:'\tgit log -4 >actual &&\n' span_id:811) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-rm-remove actual &&\n' span_id:812) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes show HEAD^\n' span_id:813) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'removing non-existing note should not create new commit' span_id: 820 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:824) (Token id: Id.Lit_Chars val: '\tgit rev-parse --verify refs/notes/commits >before_commit &&\n' span_id: 825 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes remove HEAD^ &&\n' span_id:826) (Token id: Id.Lit_Chars val: '\tgit rev-parse --verify refs/notes/commits >after_commit &&\n' span_id: 827 ) (Token id:Id.Lit_Chars val:'\ttest_cmp before_commit after_commit\n' span_id:828) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'removing more than one' span_id:835))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:839) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 840 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 841 ) (Token id:Id.Lit_Chars val:'\n' span_id:842) (Token id: Id.Lit_Chars val: '\t# We have only two -- add another and make sure it stays\n' span_id: 843 ) (Token id:Id.Lit_Chars val:'\tgit notes add -m "extra" &&\n' span_id:844) (Token id: Id.Lit_Chars val: '\tgit notes list HEAD >after-removal-expect &&\n' span_id: 845 ) (Token id:Id.Lit_Chars val:'\tgit notes remove HEAD^^ HEAD^^^ &&\n' span_id:846) (Token id: Id.Lit_Chars val: '\tgit notes list | sed -e "s/ .*//" >actual &&\n' span_id: 847 ) (Token id:Id.Lit_Chars val:'\ttest_cmp after-removal-expect actual\n' span_id:848) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'removing is atomic' span_id:855))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:859) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 860 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 861 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes remove HEAD^^ HEAD^^^ HEAD^ &&\n' span_id:862) (Token id: Id.Lit_Chars val: '\tafter=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 863 ) (Token id:Id.Lit_Chars val:'\ttest "$before" = "$after"\n' span_id:864) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'removing with --ignore-missing' span_id:871))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:875) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 876 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 877 ) (Token id:Id.Lit_Chars val:'\n' span_id:878) (Token id: Id.Lit_Chars val: '\t# We have only two -- add another and make sure it stays\n' span_id: 879 ) (Token id:Id.Lit_Chars val:'\tgit notes add -m "extra" &&\n' span_id:880) (Token id: Id.Lit_Chars val: '\tgit notes list HEAD >after-removal-expect &&\n' span_id: 881 ) (Token id: Id.Lit_Chars val: '\tgit notes remove --ignore-missing HEAD^^ HEAD^^^ HEAD^ &&\n' span_id: 882 ) (Token id:Id.Lit_Chars val:'\tgit notes list | sed -e "s/ .*//" >actual &&\n' span_id:883) (Token id: Id.Lit_Chars val: '\ttest_cmp after-removal-expect actual\n' span_id: 884 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'removing with --ignore-missing but bogus ref' span_id:891))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:895) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 896 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 897 ) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes remove --ignore-missing HEAD^^ HEAD^^^ NO-SUCH-COMMIT &&\n' span_id: 898 ) (Token id:Id.Lit_Chars val:'\tafter=$(git rev-parse --verify refs/notes/commits) &&\n' span_id:899) (Token id:Id.Lit_Chars val:'\ttest "$before" = "$after"\n' span_id:900) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'remove reads from --stdin' span_id:907))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:911) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 912 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 913 ) (Token id:Id.Lit_Chars val:'\n' span_id:914) (Token id: Id.Lit_Chars val: '\t# We have only two -- add another and make sure it stays\n' span_id: 915 ) (Token id:Id.Lit_Chars val:'\tgit notes add -m "extra" &&\n' span_id:916) (Token id: Id.Lit_Chars val: '\tgit notes list HEAD >after-removal-expect &&\n' span_id: 917 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse HEAD^^ HEAD^^^ >input &&\n' span_id:918) (Token id:Id.Lit_Chars val:'\tgit notes remove --stdin <input &&\n' span_id:919) (Token id:Id.Lit_Chars val:'\tgit notes list | sed -e "s/ .*//" >actual &&\n' span_id:920) (Token id: Id.Lit_Chars val: '\ttest_cmp after-removal-expect actual\n' span_id: 921 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'remove --stdin is also atomic' span_id:928))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:932) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 933 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 934 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\n' span_id:935) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes remove --stdin <input &&\n' span_id: 936 ) (Token id:Id.Lit_Chars val:'\tafter=$(git rev-parse --verify refs/notes/commits) &&\n' span_id:937) (Token id:Id.Lit_Chars val:'\ttest "$before" = "$after"\n' span_id:938) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'removing with --stdin --ignore-missing' span_id:945))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:949) (Token id: Id.Lit_Chars val: '\tbefore=$(git rev-parse --verify refs/notes/commits) &&\n' span_id: 950 ) (Token id: Id.Lit_Chars val: '\ttest_when_finished "git update-ref refs/notes/commits $before" &&\n' span_id: 951 ) (Token id:Id.Lit_Chars val:'\n' span_id:952) (Token id: Id.Lit_Chars val: '\t# We have only two -- add another and make sure it stays\n' span_id: 953 ) (Token id:Id.Lit_Chars val:'\tgit notes add -m "extra" &&\n' span_id:954) (Token id: Id.Lit_Chars val: '\tgit notes list HEAD >after-removal-expect &&\n' span_id: 955 ) (Token id:Id.Lit_Chars val:'\tgit rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\n' span_id:956) (Token id: Id.Lit_Chars val: '\tgit notes remove --ignore-missing --stdin <input &&\n' span_id: 957 ) (Token id:Id.Lit_Chars val:'\tgit notes list | sed -e "s/ .*//" >actual &&\n' span_id:958) (Token id: Id.Lit_Chars val: '\ttest_cmp after-removal-expect actual\n' span_id: 959 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'list notes with "git notes list"' span_id:966))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:970) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:971) (Token id: Id.Lit_Chars val: '\t\tc9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n' span_id: 972 ) (Token id: Id.Lit_Chars val: '\t\tc18dc024e14f08d18d14eea0d747ff692d66d6a3 d07d62e5208f22eb5695e7eb47667dc8b9860290\n' span_id: 973 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:974) (Token id:Id.Lit_Chars val:'\tgit notes list >actual &&\n' span_id:975) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:976) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'list notes with "git notes"' span_id:983))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:987) (Token id:Id.Lit_Chars val:'\tgit notes >actual &&\n' span_id:988) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:989) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'list specific note with "git notes list <object>"' span_id: 996 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1000) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1001) (Token id:Id.Lit_Chars val:'\t\tc18dc024e14f08d18d14eea0d747ff692d66d6a3\n' span_id:1002) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1003) (Token id:Id.Lit_Chars val:'\tgit notes list HEAD^^ >actual &&\n' span_id:1004) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1005) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'listing non-existing notes fails' span_id:1012))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1016) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1017) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1018) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes list HEAD >actual &&\n' span_id: 1019 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1020) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'append to existing note with "git notes append"' span_id: 1027 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1031) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1032) (Token id:Id.Lit_Chars val:'\t\tInitial set of notes\n' span_id:1033) (Token id:Id.Lit_Chars val:'\n' span_id:1034) (Token id:Id.Lit_Chars val:'\t\tMore notes appended with git notes append\n' span_id:1035) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1036) (Token id:Id.Lit_Chars val:'\tgit notes add -m "Initial set of notes" &&\n' span_id:1037) (Token id: Id.Lit_Chars val: '\tgit notes append -m "More notes appended with git notes append" &&\n' span_id: 1038 ) (Token id:Id.Lit_Chars val:'\tgit notes show >actual &&\n' span_id:1039) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1040) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: '"git notes list" does not expand to "git notes list HEAD"' span_id: 1047 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1051) (Token id:Id.Lit_Chars val:'\tcat >expect_list <<-EOF &&\n' span_id:1052) (Token id: Id.Lit_Chars val: '\t\tc9c6af7f78bc47490dbf3e822cf2f3c24d4b9061 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n' span_id: 1053 ) (Token id: Id.Lit_Chars val: '\t\t4b6ad22357cc8a1296720574b8d2fbc22fab0671 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n' span_id: 1054 ) (Token id: Id.Lit_Chars val: '\t\tc18dc024e14f08d18d14eea0d747ff692d66d6a3 d07d62e5208f22eb5695e7eb47667dc8b9860290\n' span_id: 1055 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1056) (Token id:Id.Lit_Chars val:'\tgit notes list >actual &&\n' span_id:1057) (Token id:Id.Lit_Chars val:'\ttest_cmp expect_list actual\n' span_id:1058) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'appending empty string does not change existing note' span_id: 1065 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1069) (Token id:Id.Lit_Chars val:'\tgit notes append -m "" &&\n' span_id:1070) (Token id:Id.Lit_Chars val:'\tgit notes show >actual &&\n' span_id:1071) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1072) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'git notes append == add when there is no existing note' span_id: 1079 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1083) (Token id:Id.Lit_Chars val:'\tgit notes remove HEAD &&\n' span_id:1084) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes list HEAD &&\n' span_id:1085) (Token id: Id.Lit_Chars val: '\tgit notes append -m "Initial set of notes${LF}${LF}More notes appended with git notes append" &&\n' span_id: 1086 ) (Token id:Id.Lit_Chars val:'\tgit notes show >actual &&\n' span_id:1087) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1088) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'appending empty string to non-existing note does not create note' span_id: 1095 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1099) (Token id:Id.Lit_Chars val:'\tgit notes remove HEAD &&\n' span_id:1100) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes list HEAD &&\n' span_id:1101) (Token id:Id.Lit_Chars val:'\tgit notes append -m "" &&\n' span_id:1102) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes list HEAD\n' span_id:1103) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create other note on a different notes ref (setup)' span_id: 1110 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1114) (Token id:Id.Lit_Chars val:'\ttest_commit 6th &&\n' span_id:1115) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REF="refs/notes/other" git notes add -m "other note" &&\n' span_id: 1116 ) (Token id:Id.Lit_Chars val:'\tcat >expect-not-other <<-EOF &&\n' span_id:1117) (Token id: Id.Lit_Chars val: '\t\tcommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n' span_id: 1118 ) (Token id:Id.Lit_Chars val:'\t\tAuthor: A U Thor <author@example.com>\n' span_id:1119) (Token id: Id.Lit_Chars val: '\t\tDate: Thu Apr 7 15:18:13 2005 -0700\n' span_id: 1120 ) (Token id:Id.Lit_Chars val:'\n' span_id:1121) (Token id:Id.Lit_Chars val:'\t\t${indent}6th\n' span_id:1122) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1123) (Token id: Id.Lit_Chars val: '\tcp expect-not-other expect-other &&\n' span_id: 1124 ) (Token id:Id.Lit_Chars val:'\tcat >>expect-other <<-EOF\n' span_id:1125) (Token id:Id.Lit_Chars val:'\n' span_id:1126) (Token id:Id.Lit_Chars val:'\t\tNotes (other):\n' span_id:1127) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1128) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1129) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'Do not show note on other ref by default' span_id:1136))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1140) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1141) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-not-other actual\n' span_id:1142) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'Do show note when ref is given in GIT_NOTES_REF' span_id: 1149 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1153) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REF="refs/notes/other" git log -1 >actual &&\n' span_id: 1154 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-other actual\n' span_id:1155) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'Do show note when ref is given in core.notesRef config' span_id: 1162 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1166) (Token id: Id.Lit_Chars val: '\ttest_config core.notesRef "refs/notes/other" &&\n' span_id: 1167 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1168) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-other actual\n' span_id:1169) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'Do not show note when core.notesRef is overridden' span_id: 1176 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1180) (Token id: Id.Lit_Chars val: '\ttest_config core.notesRef "refs/notes/other" &&\n' span_id: 1181 ) (Token id:Id.Lit_Chars val:'\tGIT_NOTES_REF="refs/notes/wrong" git log -1 >actual &&\n' span_id:1182) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-not-other actual\n' span_id:1183) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'Show all notes when notes.displayRef=refs/notes/*' span_id: 1190 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1194) (Token id:Id.Lit_Chars val:'\tcat >expect-both <<-EOF &&\n' span_id:1195) (Token id:Id.Lit_Chars val:'\t\tcommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n' span_id:1196) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1197 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:18:13 2005 -0700\n' span_id:1198) (Token id:Id.Lit_Chars val:'\n' span_id:1199) (Token id:Id.Lit_Chars val:'\t\t${indent}6th\n' span_id:1200) (Token id:Id.Lit_Chars val:'\n' span_id:1201) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1202) (Token id:Id.Lit_Chars val:'\t\t${indent}order test\n' span_id:1203) (Token id:Id.Lit_Chars val:'\n' span_id:1204) (Token id:Id.Lit_Chars val:'\t\tNotes (other):\n' span_id:1205) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1206) (Token id:Id.Lit_Chars val:'\n' span_id:1207) (Token id:Id.Lit_Chars val:'\t\tcommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n' span_id:1208) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1209 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:17:13 2005 -0700\n' span_id:1210) (Token id:Id.Lit_Chars val:'\n' span_id:1211) (Token id:Id.Lit_Chars val:'\t\t${indent}5th\n' span_id:1212) (Token id:Id.Lit_Chars val:'\n' span_id:1213) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1214) (Token id: Id.Lit_Chars val: '\t\t${indent}replacement for deleted note\n' span_id: 1215 ) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1216) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REF=refs/notes/commits git notes add \\\n' span_id: 1217 ) (Token id:Id.Lit_Chars val:'\t\t-m"replacement for deleted note" HEAD^ &&\n' span_id:1218) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REF=refs/notes/commits git notes add -m"order test" &&\n' span_id: 1219 ) (Token id:Id.Lit_Chars val:'\ttest_unconfig core.notesRef &&\n' span_id:1220) (Token id: Id.Lit_Chars val: '\ttest_config notes.displayRef "refs/notes/*" &&\n' span_id: 1221 ) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1222) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both actual\n' span_id:1223) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'core.notesRef is implicitly in notes.displayRef' span_id: 1230 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1234) (Token id: Id.Lit_Chars val: '\ttest_config core.notesRef refs/notes/commits &&\n' span_id: 1235 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.displayRef refs/notes/other &&\n' span_id:1236) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1237) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both actual\n' span_id:1238) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'notes.displayRef can be given more than once' span_id:1245))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1249) (Token id:Id.Lit_Chars val:'\ttest_unconfig core.notesRef &&\n' span_id:1250) (Token id:Id.Lit_Chars val:'\ttest_config notes.displayRef refs/notes/commits &&\n' span_id:1251) (Token id: Id.Lit_Chars val: '\tgit config --add notes.displayRef refs/notes/other &&\n' span_id: 1252 ) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1253) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both actual\n' span_id:1254) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'notes.displayRef respects order' span_id:1261))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1265) (Token id: Id.Lit_Chars val: '\tcat >expect-both-reversed <<-EOF &&\n' span_id: 1266 ) (Token id:Id.Lit_Chars val:'\t\tcommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n' span_id:1267) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1268 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:18:13 2005 -0700\n' span_id:1269) (Token id:Id.Lit_Chars val:'\n' span_id:1270) (Token id:Id.Lit_Chars val:'\t\t${indent}6th\n' span_id:1271) (Token id:Id.Lit_Chars val:'\n' span_id:1272) (Token id:Id.Lit_Chars val:'\t\tNotes (other):\n' span_id:1273) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1274) (Token id:Id.Lit_Chars val:'\n' span_id:1275) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1276) (Token id:Id.Lit_Chars val:'\t\t${indent}order test\n' span_id:1277) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1278) (Token id: Id.Lit_Chars val: '\ttest_config core.notesRef refs/notes/other &&\n' span_id: 1279 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.displayRef refs/notes/commits &&\n' span_id:1280) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1281) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both-reversed actual\n' span_id:1282) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'GIT_NOTES_DISPLAY_REF works' span_id:1289))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1293) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n' span_id: 1294 ) (Token id:Id.Lit_Chars val:'\t\tgit log -2 >actual &&\n' span_id:1295) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both actual\n' span_id:1296) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'GIT_NOTES_DISPLAY_REF overrides config' span_id:1303))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1307) (Token id:Id.Lit_Chars val:'\tcat >expect-none <<-EOF &&\n' span_id:1308) (Token id:Id.Lit_Chars val:'\t\tcommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n' span_id:1309) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1310 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:18:13 2005 -0700\n' span_id:1311) (Token id:Id.Lit_Chars val:'\n' span_id:1312) (Token id:Id.Lit_Chars val:'\t\t${indent}6th\n' span_id:1313) (Token id:Id.Lit_Chars val:'\n' span_id:1314) (Token id:Id.Lit_Chars val:'\t\tcommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n' span_id:1315) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1316 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:17:13 2005 -0700\n' span_id:1317) (Token id:Id.Lit_Chars val:'\n' span_id:1318) (Token id:Id.Lit_Chars val:'\t\t${indent}5th\n' span_id:1319) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1320) (Token id:Id.Lit_Chars val:'\ttest_config notes.displayRef "refs/notes/*" &&\n' span_id:1321) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >actual &&\n' span_id: 1322 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-none actual\n' span_id:1323) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--show-notes=* adds to GIT_NOTES_DISPLAY_REF' span_id:1330))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1334) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >actual &&\n' span_id: 1335 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both actual\n' span_id:1336) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:--no-standard-notes span_id:1343))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1347) (Token id:Id.Lit_Chars val:'\tcat >expect-commits <<-EOF &&\n' span_id:1348) (Token id:Id.Lit_Chars val:'\t\tcommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n' span_id:1349) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1350 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:18:13 2005 -0700\n' span_id:1351) (Token id:Id.Lit_Chars val:'\n' span_id:1352) (Token id:Id.Lit_Chars val:'\t\t${indent}6th\n' span_id:1353) (Token id:Id.Lit_Chars val:'\n' span_id:1354) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1355) (Token id:Id.Lit_Chars val:'\t\t${indent}order test\n' span_id:1356) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1357) (Token id: Id.Lit_Chars val: '\tgit log --no-standard-notes --show-notes=commits -1 >actual &&\n' span_id: 1358 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-commits actual\n' span_id:1359) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:--standard-notes span_id:1366))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1370) (Token id: Id.Lit_Chars val: '\ttest_config notes.displayRef "refs/notes/*" &&\n' span_id: 1371 ) (Token id:Id.Lit_Chars val:'\tgit log --no-standard-notes --show-notes=commits \\\n' span_id:1372) (Token id:Id.Lit_Chars val:'\t\t--standard-notes -2 >actual &&\n' span_id:1373) (Token id:Id.Lit_Chars val:'\ttest_cmp expect-both actual\n' span_id:1374) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'--show-notes=ref accumulates' span_id:1381))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1385) (Token id: Id.Lit_Chars val: '\tgit log --show-notes=other --show-notes=commits \\\n' span_id: 1386 ) (Token id:Id.Lit_Chars val:'\t\t --no-standard-notes -1 >actual &&\n' span_id:1387) (Token id: Id.Lit_Chars val: '\ttest_cmp expect-both-reversed actual\n' span_id: 1388 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'Allow notes on non-commits (trees, blobs, tags)' span_id: 1395 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1399) (Token id: Id.Lit_Chars val: '\ttest_config core.notesRef refs/notes/other &&\n' span_id: 1400 ) (Token id:Id.Lit_Chars val:'\techo "Note on a tree" >expect &&\n' span_id:1401) (Token id: Id.Lit_Chars val: '\tgit notes add -m "Note on a tree" HEAD: &&\n' span_id: 1402 ) (Token id:Id.Lit_Chars val:'\tgit notes show HEAD: >actual &&\n' span_id:1403) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1404) (Token id:Id.Lit_Chars val:'\techo "Note on a blob" >expect &&\n' span_id:1405) (Token id: Id.Lit_Chars val: '\tfilename=$(git ls-tree --name-only HEAD | head -n1) &&\n' span_id: 1406 ) (Token id:Id.Lit_Chars val:'\tgit notes add -m "Note on a blob" HEAD:$filename &&\n' span_id:1407) (Token id: Id.Lit_Chars val: '\tgit notes show HEAD:$filename >actual &&\n' span_id: 1408 ) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1409) (Token id:Id.Lit_Chars val:'\techo "Note on a tag" >expect &&\n' span_id:1410) (Token id: Id.Lit_Chars val: '\tgit tag -a -m "This is an annotated tag" foobar HEAD^ &&\n' span_id: 1411 ) (Token id:Id.Lit_Chars val:'\tgit notes add -m "Note on a tag" foobar &&\n' span_id:1412) (Token id:Id.Lit_Chars val:'\tgit notes show foobar >actual &&\n' span_id:1413) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1414) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from other note with "git notes add -C"' span_id: 1421 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1425) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1426) (Token id:Id.Lit_Chars val:'\t\tcommit fb01e0ca8c33b6cc0c6451dde747f97df567cb5c\n' span_id:1427) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1428 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:19:13 2005 -0700\n' span_id:1429) (Token id:Id.Lit_Chars val:'\n' span_id:1430) (Token id:Id.Lit_Chars val:'\t\t${indent}7th\n' span_id:1431) (Token id:Id.Lit_Chars val:'\n' span_id:1432) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1433) (Token id:Id.Lit_Chars val:'\t\t${indent}order test\n' span_id:1434) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1435) (Token id:Id.Lit_Chars val:'\ttest_commit 7th &&\n' span_id:1436) (Token id:Id.Lit_Chars val:'\tgit notes add -C $(git notes list HEAD^) &&\n' span_id:1437) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1438) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1439) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD)" = "$(git notes list HEAD^)"\n' span_id: 1440 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from non-existing note with "git notes add -C" fails' span_id: 1447 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1451) (Token id:Id.Lit_Chars val:'\ttest_commit 8th &&\n' span_id:1452) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes add -C deadbeef &&\n' span_id:1453) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes list HEAD\n' span_id:1454) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from non-blob with "git notes add -C" fails' span_id: 1461 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1465) (Token id: Id.Lit_Chars val: '\tcommit=$(git rev-parse --verify HEAD) &&\n' span_id: 1466 ) (Token id:Id.Lit_Chars val:'\ttree=$(git rev-parse --verify HEAD:) &&\n' span_id:1467) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes add -C $commit &&\n' span_id: 1468 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes add -C $tree &&\n' span_id:1469) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes list HEAD\n' span_id:1470) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from blob with "git notes add -C" reuses blob id' span_id: 1477 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1481) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1482) (Token id:Id.Lit_Chars val:'\t\tcommit 9a4c31c7f722b5d517e92c64e932dd751e1413bf\n' span_id:1483) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1484 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:20:13 2005 -0700\n' span_id:1485) (Token id:Id.Lit_Chars val:'\n' span_id:1486) (Token id:Id.Lit_Chars val:'\t\t${indent}8th\n' span_id:1487) (Token id:Id.Lit_Chars val:'\n' span_id:1488) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1489) (Token id:Id.Lit_Chars val:'\t\t${indent}This is a blob object\n' span_id:1490) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1491) (Token id: Id.Lit_Chars val: '\tblob=$(echo "This is a blob object" | git hash-object -w --stdin) &&\n' span_id: 1492 ) (Token id:Id.Lit_Chars val:'\tgit notes add -C $blob &&\n' span_id:1493) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1494) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1495) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD)" = "$blob"\n' span_id: 1496 ) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from other note with "git notes add -c"' span_id: 1503 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1507) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1508) (Token id:Id.Lit_Chars val:'\t\tcommit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\n' span_id:1509) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1510 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:21:13 2005 -0700\n' span_id:1511) (Token id:Id.Lit_Chars val:'\n' span_id:1512) (Token id:Id.Lit_Chars val:'\t\t${indent}9th\n' span_id:1513) (Token id:Id.Lit_Chars val:'\n' span_id:1514) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1515) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1516) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1517) (Token id:Id.Lit_Chars val:'\ttest_commit 9th &&\n' span_id:1518) (Token id: Id.Lit_Chars val: '\tMSG="yet another note" git notes add -c $(git notes list HEAD^^) &&\n' span_id: 1519 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1520) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1521) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from non-existing note with "git notes add -c" fails' span_id: 1528 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1532) (Token id:Id.Lit_Chars val:'\ttest_commit 10th &&\n' span_id:1533) (Token id: Id.Lit_Chars val: '\ttest_must_fail env MSG="yet another note" git notes add -c deadbeef &&\n' span_id: 1534 ) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes list HEAD\n' span_id:1535) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'append to note from other note with "git notes append -C"' span_id: 1542 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1546) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1547) (Token id:Id.Lit_Chars val:'\t\tcommit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\n' span_id:1548) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1549 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:21:13 2005 -0700\n' span_id:1550) (Token id:Id.Lit_Chars val:'\n' span_id:1551) (Token id:Id.Lit_Chars val:'\t\t${indent}9th\n' span_id:1552) (Token id:Id.Lit_Chars val:'\n' span_id:1553) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1554) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1555) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1556) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1557) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1558) (Token id: Id.Lit_Chars val: '\tgit notes append -C $(git notes list HEAD^) HEAD^ &&\n' span_id: 1559 ) (Token id:Id.Lit_Chars val:'\tgit log -1 HEAD^ >actual &&\n' span_id:1560) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1561) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'create note from other note with "git notes append -c"' span_id: 1568 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1572) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1573) (Token id:Id.Lit_Chars val:'\t\tcommit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\n' span_id:1574) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1575 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:22:13 2005 -0700\n' span_id:1576) (Token id:Id.Lit_Chars val:'\n' span_id:1577) (Token id:Id.Lit_Chars val:'\t\t${indent}10th\n' span_id:1578) (Token id:Id.Lit_Chars val:'\n' span_id:1579) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1580) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1581) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1582) (Token id: Id.Lit_Chars val: '\tMSG="other note" git notes append -c $(git notes list HEAD^) &&\n' span_id: 1583 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1584) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1585) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'append to note from other note with "git notes append -c"' span_id: 1592 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1596) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1597) (Token id:Id.Lit_Chars val:'\t\tcommit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\n' span_id:1598) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1599 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:22:13 2005 -0700\n' span_id:1600) (Token id:Id.Lit_Chars val:'\n' span_id:1601) (Token id:Id.Lit_Chars val:'\t\t${indent}10th\n' span_id:1602) (Token id:Id.Lit_Chars val:'\n' span_id:1603) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1604) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1605) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1606) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1607) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1608) (Token id: Id.Lit_Chars val: '\tMSG="yet another note" git notes append -c $(git notes list HEAD) &&\n' span_id: 1609 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1610) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1611) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'copy note with "git notes copy"' span_id:1618))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1622) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1623) (Token id:Id.Lit_Chars val:'\t\tcommit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n' span_id:1624) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1625 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:23:13 2005 -0700\n' span_id:1626) (Token id:Id.Lit_Chars val:'\n' span_id:1627) (Token id:Id.Lit_Chars val:'\t\t${indent}11th\n' span_id:1628) (Token id:Id.Lit_Chars val:'\n' span_id:1629) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1630) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1631) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1632) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1633) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1634) (Token id:Id.Lit_Chars val:'\ttest_commit 11th &&\n' span_id:1635) (Token id:Id.Lit_Chars val:'\tgit notes copy HEAD^ HEAD &&\n' span_id:1636) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1637) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1638) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD)" = "$(git notes list HEAD^)"\n' span_id: 1639 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'prevent overwrite with "git notes copy"' span_id:1646))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1650) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes copy HEAD~2 HEAD &&\n' span_id: 1651 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1652) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1653) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD)" = "$(git notes list HEAD^)"\n' span_id: 1654 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'allow overwrite with "git notes copy -f"' span_id:1661))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1665) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1666) (Token id:Id.Lit_Chars val:'\t\tcommit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n' span_id:1667) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1668 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:23:13 2005 -0700\n' span_id:1669) (Token id:Id.Lit_Chars val:'\n' span_id:1670) (Token id:Id.Lit_Chars val:'\t\t${indent}11th\n' span_id:1671) (Token id:Id.Lit_Chars val:'\n' span_id:1672) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1673) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1674) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1675) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1676) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1677) (Token id:Id.Lit_Chars val:'\tgit notes copy -f HEAD~2 HEAD &&\n' span_id:1678) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1679) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1680) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD)" = "$(git notes list HEAD~2)"\n' span_id: 1681 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'cannot copy note from object without notes' span_id:1688))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1692) (Token id:Id.Lit_Chars val:'\ttest_commit 12th &&\n' span_id:1693) (Token id:Id.Lit_Chars val:'\ttest_commit 13th &&\n' span_id:1694) (Token id: Id.Lit_Chars val: '\ttest_must_fail git notes copy HEAD^ HEAD\n' span_id: 1695 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --stdin' span_id:1702))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1706) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1707) (Token id:Id.Lit_Chars val:'\t\tcommit e871aa61182b1d95d0a6fb75445d891722863b6b\n' span_id:1708) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1709 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:25:13 2005 -0700\n' span_id:1710) (Token id:Id.Lit_Chars val:'\n' span_id:1711) (Token id:Id.Lit_Chars val:'\t\t${indent}13th\n' span_id:1712) (Token id:Id.Lit_Chars val:'\n' span_id:1713) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1714) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1715) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1716) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1717) (Token id:Id.Lit_Chars val:'\n' span_id:1718) (Token id: Id.Lit_Chars val: '\t\tcommit 65e263ded02ae4e8839bc151095113737579dc12\n' span_id: 1719 ) (Token id:Id.Lit_Chars val:'\t\tAuthor: A U Thor <author@example.com>\n' span_id:1720) (Token id: Id.Lit_Chars val: '\t\tDate: Thu Apr 7 15:24:13 2005 -0700\n' span_id: 1721 ) (Token id:Id.Lit_Chars val:'\n' span_id:1722) (Token id:Id.Lit_Chars val:'\t\t${indent}12th\n' span_id:1723) (Token id:Id.Lit_Chars val:'\n' span_id:1724) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1725) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1726) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1727) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1728) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1729) (Token id: Id.Lit_Chars val: '\t(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n' span_id: 1730 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n' span_id:1731) (Token id:Id.Lit_Chars val:'\tgit notes copy --stdin &&\n' span_id:1732) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1733) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual &&\n' span_id:1734) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD)" = "$(git notes list HEAD~2)" &&\n' span_id: 1735 ) (Token id: Id.Lit_Chars val: '\ttest "$(git notes list HEAD^)" = "$(git notes list HEAD~3)"\n' span_id: 1736 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (unconfigured)' span_id:1743))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1747) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1748) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1749) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1750 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1751) (Token id:Id.Lit_Chars val:'\n' span_id:1752) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1753) (Token id:Id.Lit_Chars val:'\n' span_id:1754) (Token id:Id.Lit_Chars val:'\t\tcommit 07c85d77059393ed0154b8c96906547a59dfcddd\n' span_id:1755) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1756 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:26:13 2005 -0700\n' span_id:1757) (Token id:Id.Lit_Chars val:'\n' span_id:1758) (Token id:Id.Lit_Chars val:'\t\t${indent}14th\n' span_id:1759) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1760) (Token id:Id.Lit_Chars val:'\ttest_commit 14th &&\n' span_id:1761) (Token id:Id.Lit_Chars val:'\ttest_commit 15th &&\n' span_id:1762) (Token id: Id.Lit_Chars val: '\t(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n' span_id: 1763 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n' span_id:1764) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=foo &&\n' span_id: 1765 ) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1766) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1767) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (enabled)' span_id:1774))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1778) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1779) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1780) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1781 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1782) (Token id:Id.Lit_Chars val:'\n' span_id:1783) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1784) (Token id:Id.Lit_Chars val:'\n' span_id:1785) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1786) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1787) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1788) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1789) (Token id:Id.Lit_Chars val:'\n' span_id:1790) (Token id: Id.Lit_Chars val: '\t\tcommit 07c85d77059393ed0154b8c96906547a59dfcddd\n' span_id: 1791 ) (Token id:Id.Lit_Chars val:'\t\tAuthor: A U Thor <author@example.com>\n' span_id:1792) (Token id: Id.Lit_Chars val: '\t\tDate: Thu Apr 7 15:26:13 2005 -0700\n' span_id: 1793 ) (Token id:Id.Lit_Chars val:'\n' span_id:1794) (Token id:Id.Lit_Chars val:'\t\t${indent}14th\n' span_id:1795) (Token id:Id.Lit_Chars val:'\n' span_id:1796) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1797) (Token id:Id.Lit_Chars val:'\t\t${indent}other note\n' span_id:1798) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1799) (Token id:Id.Lit_Chars val:'\t\t${indent}yet another note\n' span_id:1800) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1801) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteMode overwrite &&\n' span_id: 1802 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id:1803) (Token id: Id.Lit_Chars val: '\t(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n' span_id: 1804 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n' span_id:1805) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=foo &&\n' span_id: 1806 ) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1807) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1808) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (disabled)' span_id:1815))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1819) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewrite.bar false &&\n' span_id: 1820 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD~3) $(git rev-parse HEAD) |\n' span_id:1821) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=bar &&\n' span_id: 1822 ) (Token id:Id.Lit_Chars val:'\tgit log -2 >actual &&\n' span_id:1823) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1824) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (overwrite)' span_id:1831))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1835) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1836) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1837) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1838 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1839) (Token id:Id.Lit_Chars val:'\n' span_id:1840) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1841) (Token id:Id.Lit_Chars val:'\n' span_id:1842) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1843) (Token id:Id.Lit_Chars val:'\t\t${indent}a fresh note\n' span_id:1844) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1845) (Token id: Id.Lit_Chars val: '\tgit notes add -f -m"a fresh note" HEAD^ &&\n' span_id: 1846 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteMode overwrite &&\n' span_id:1847) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id: 1848 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id:1849) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=foo &&\n' span_id: 1850 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1851) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1852) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (ignore)' span_id:1859))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1863) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteMode ignore &&\n' span_id: 1864 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id:1865) (Token id: Id.Lit_Chars val: '\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id: 1866 ) (Token id:Id.Lit_Chars val:'\tgit notes copy --for-rewrite=foo &&\n' span_id:1867) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1868) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1869) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (append)' span_id:1876))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1880) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1881) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1882) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1883 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1884) (Token id:Id.Lit_Chars val:'\n' span_id:1885) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1886) (Token id:Id.Lit_Chars val:'\n' span_id:1887) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1888) (Token id:Id.Lit_Chars val:'\t\t${indent}a fresh note\n' span_id:1889) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1890) (Token id:Id.Lit_Chars val:'\t\t${indent}another fresh note\n' span_id:1891) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1892) (Token id: Id.Lit_Chars val: '\tgit notes add -f -m"another fresh note" HEAD^ &&\n' span_id: 1893 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteMode concatenate &&\n' span_id:1894) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id: 1895 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id:1896) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=foo &&\n' span_id: 1897 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1898) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1899) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'git notes copy --for-rewrite (append two to one)' span_id: 1906 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1910) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1911) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1912) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1913 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1914) (Token id:Id.Lit_Chars val:'\n' span_id:1915) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1916) (Token id:Id.Lit_Chars val:'\n' span_id:1917) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1918) (Token id:Id.Lit_Chars val:'\t\t${indent}a fresh note\n' span_id:1919) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1920) (Token id:Id.Lit_Chars val:'\t\t${indent}another fresh note\n' span_id:1921) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1922) (Token id:Id.Lit_Chars val:'\t\t${indent}append 1\n' span_id:1923) (Token id:Id.Lit_Chars val:'\t\t${indent}\n' span_id:1924) (Token id:Id.Lit_Chars val:'\t\t${indent}append 2\n' span_id:1925) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1926) (Token id: Id.Lit_Chars val: '\tgit notes add -f -m"append 1" HEAD^ &&\n' span_id: 1927 ) (Token id:Id.Lit_Chars val:'\tgit notes add -f -m"append 2" HEAD^^ &&\n' span_id:1928) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteMode concatenate &&\n' span_id: 1929 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id:1930) (Token id: Id.Lit_Chars val: '\t(echo $(git rev-parse HEAD^) $(git rev-parse HEAD);\n' span_id: 1931 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^^) $(git rev-parse HEAD)) |\n' span_id:1932) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=foo &&\n' span_id: 1933 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1934) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1935) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes copy --for-rewrite (append empty)' span_id:1942))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1946) (Token id:Id.Lit_Chars val:'\tgit notes remove HEAD^ &&\n' span_id:1947) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteMode concatenate &&\n' span_id:1948) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id: 1949 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id:1950) (Token id: Id.Lit_Chars val: '\tgit notes copy --for-rewrite=foo &&\n' span_id: 1951 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1952) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1953) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'GIT_NOTES_REWRITE_MODE works' span_id:1960))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1964) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1965) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1966) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1967 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1968) (Token id:Id.Lit_Chars val:'\n' span_id:1969) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1970) (Token id:Id.Lit_Chars val:'\n' span_id:1971) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:1972) (Token id:Id.Lit_Chars val:'\t\t${indent}replacement note 1\n' span_id:1973) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:1974) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteMode concatenate &&\n' span_id: 1975 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteRef "refs/notes/*" &&\n' span_id:1976) (Token id: Id.Lit_Chars val: '\tgit notes add -f -m"replacement note 1" HEAD^ &&\n' span_id: 1977 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id:1978) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo &&\n' span_id: 1979 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:1980) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:1981) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'GIT_NOTES_REWRITE_REF works' span_id:1988))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:1992) (Token id:Id.Lit_Chars val:'\tcat >expect <<-EOF &&\n' span_id:1993) (Token id:Id.Lit_Chars val:'\t\tcommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n' span_id:1994) (Token id: Id.Lit_Chars val: '\t\tAuthor: A U Thor <author@example.com>\n' span_id: 1995 ) (Token id:Id.Lit_Chars val:'\t\tDate: Thu Apr 7 15:27:13 2005 -0700\n' span_id:1996) (Token id:Id.Lit_Chars val:'\n' span_id:1997) (Token id:Id.Lit_Chars val:'\t\t${indent}15th\n' span_id:1998) (Token id:Id.Lit_Chars val:'\n' span_id:1999) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:2000) (Token id:Id.Lit_Chars val:'\t\t${indent}replacement note 2\n' span_id:2001) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:2002) (Token id: Id.Lit_Chars val: '\tgit notes add -f -m"replacement note 2" HEAD^ &&\n' span_id: 2003 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteMode overwrite &&\n' span_id:2004) (Token id:Id.Lit_Chars val:'\ttest_unconfig notes.rewriteRef &&\n' span_id:2005) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id:2006) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \\\n' span_id: 2007 ) (Token id:Id.Lit_Chars val:'\t\tgit notes copy --for-rewrite=foo &&\n' span_id:2008) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:2009) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2010) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'GIT_NOTES_REWRITE_REF overrides config' span_id:2017))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2021) (Token id: Id.Lit_Chars val: '\tgit notes add -f -m"replacement note 3" HEAD^ &&\n' span_id: 2022 ) (Token id:Id.Lit_Chars val:'\ttest_config notes.rewriteMode overwrite &&\n' span_id:2023) (Token id: Id.Lit_Chars val: '\ttest_config notes.rewriteRef refs/notes/other &&\n' span_id: 2024 ) (Token id:Id.Lit_Chars val:'\techo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n' span_id:2025) (Token id: Id.Lit_Chars val: '\tGIT_NOTES_REWRITE_REF= git notes copy --for-rewrite=foo &&\n' span_id: 2026 ) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:2027) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2028) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'git notes copy diagnoses too many or too few parameters' span_id: 2035 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2039) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes copy &&\n' span_id:2040) (Token id:Id.Lit_Chars val:'\ttest_must_fail git notes copy one two three\n' span_id:2041) ) } ) (C {(test_expect_success)} { (SQ (Token id: Id.Lit_Chars val: 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' span_id: 2048 ) ) } { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2052) (Token id:Id.Lit_Chars val:'\ttest_unconfig core.notesRef &&\n' span_id:2053) (Token id:Id.Lit_Chars val:'\tsane_unset GIT_NOTES_REF &&\n' span_id:2054) (Token id: Id.Lit_Chars val: '\ttest "$(git notes --ref=refs/heads/master get-ref)" = "refs/notes/refs/heads/master"\n' span_id: 2055 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes get-ref (no overrides)' span_id:2062))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2066) (Token id:Id.Lit_Chars val:'\ttest_unconfig core.notesRef &&\n' span_id:2067) (Token id:Id.Lit_Chars val:'\tsane_unset GIT_NOTES_REF &&\n' span_id:2068) (Token id: Id.Lit_Chars val: '\ttest "$(git notes get-ref)" = "refs/notes/commits"\n' span_id: 2069 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes get-ref (core.notesRef)' span_id:2076))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2080) (Token id: Id.Lit_Chars val: '\ttest_config core.notesRef refs/notes/foo &&\n' span_id: 2081 ) (Token id:Id.Lit_Chars val:'\ttest "$(git notes get-ref)" = "refs/notes/foo"\n' span_id:2082) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes get-ref (GIT_NOTES_REF)' span_id:2089))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2093) (Token id: Id.Lit_Chars val: '\ttest "$(GIT_NOTES_REF=refs/notes/bar git notes get-ref)" = "refs/notes/bar"\n' span_id: 2094 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'git notes get-ref (--ref)' span_id:2101))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2105) (Token id: Id.Lit_Chars val: '\ttest "$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)" = "refs/notes/baz"\n' span_id: 2106 ) ) } ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'setup testing of empty notes' span_id:2113))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2117) (Token id:Id.Lit_Chars val:'\ttest_unconfig core.notesRef &&\n' span_id:2118) (Token id:Id.Lit_Chars val:'\ttest_commit 16th &&\n' span_id:2119) (Token id: Id.Lit_Chars val: '\tempty_blob=$(git hash-object -w /dev/null) &&\n' span_id: 2120 ) (Token id:Id.Lit_Chars val:'\techo "$empty_blob" >expect_empty\n' span_id:2121) ) } ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:2125) cond: [(C {(read)} {(cmd)})] body: (command.DoGroup children: [ (C {(test_expect_success)} {(DQ ("'git notes ") ($ Id.VSub_DollarName '$cmd') ("' removes empty note"))} { (DQ ('\n') ('\t\ttest_might_fail git notes remove HEAD &&\n') ('\t\tMSG= git notes ') ($ Id.VSub_DollarName '$cmd') (' &&\n') ('\t\ttest_must_fail git notes list HEAD\n') ('\t') ) } ) (C {(test_expect_success)} { (DQ ("'git notes ") ($ Id.VSub_DollarName '$cmd') (" --allow-empty' stores empty note")) } { (DQ ('\n') ('\t\ttest_might_fail git notes remove HEAD &&\n') ('\t\tMSG= git notes ') ($ Id.VSub_DollarName '$cmd') (' --allow-empty &&\n') ('\t\tgit notes list HEAD >actual &&\n') ('\t\ttest_cmp expect_empty actual\n') ('\t') ) } ) ] ) redirects: [ (redir.HereDoc op: (Token id:Id.Redir_DLess val:'<<' span_id:2175) fd: -1 here_begin: {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\E' span_id:2176)) (OF) } here_end_span_id: 2190 stdin_parts: [ ('add\n') ('add -F /dev/null\n') ('add -m ""\n') ('add -c "$empty_blob"\n') ('add -C "$empty_blob"\n') ('append\n') ('append -F /dev/null\n') ('append -m ""\n') ('append -c "$empty_blob"\n') ('append -C "$empty_blob"\n') ('edit\n') ] ) ] ) (C {(test_expect_success)} {(SQ (Token id:Id.Lit_Chars val:'empty notes are displayed by git log' span_id:2195))} { (SQ (Token id:Id.Lit_Chars val:'\n' span_id:2199) (Token id:Id.Lit_Chars val:'\ttest_commit 17th &&\n' span_id:2200) (Token id:Id.Lit_Chars val:'\tgit log -1 >expect &&\n' span_id:2201) (Token id:Id.Lit_Chars val:'\tcat >>expect <<-EOF &&\n' span_id:2202) (Token id:Id.Lit_Chars val:'\n' span_id:2203) (Token id:Id.Lit_Chars val:'\t\tNotes:\n' span_id:2204) (Token id:Id.Lit_Chars val:'\tEOF\n' span_id:2205) (Token id:Id.Lit_Chars val:'\tgit notes add -C "$empty_blob" --allow-empty &&\n' span_id:2206) (Token id:Id.Lit_Chars val:'\tgit log -1 >actual &&\n' span_id:2207) (Token id:Id.Lit_Chars val:'\ttest_cmp expect actual\n' span_id:2208) ) } ) (C {(test_done)}) ] )