{"thread":{"id":"37929","subject":"mac test failure -- test 3301","startedAt":"2014-11-11T00:17:36Z","lastAt":"2014-11-11T23:57:53Z","messageCount":9,"participants":["Michael Blume","Eric Sunshine","Johan Herland","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251697","messageId":"CAO2U3QhiWVvVKivBhE5R2xhjf8SPPtg6VSaQMxw7vbm_454jBQ@mail.gmail.com","threadId":"37929","inReplyTo":null,"subject":"mac test failure -- test 3301","fromName":"Michael Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-11T00:17:36Z","receivedAt":"2014-11-11T00:17:36Z","isPatch":false,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"the commit modernizing test 3301\n(https://github.com/git/git/commit/fbe4f74865acfd) appears to break it\non my mac\n\nVerbose output follows:\n\n$ ./t3301-notes.sh -v\nInitialized empty Git repository in\n/Users/michael.blume/workspace/git/t/trash directory.t3301-notes/.git/\nexpecting success:\ntest_must_fail env MSG=3 git notes add\n\nfatal: Failed to resolve 'HEAD' as a valid ref.\nok 1 - cannot annotate non-existing HEAD\n\nexpecting success:\ntest_commit 1st &&\ntest_commit 2nd\n\n[master (root-commit) 04ed9a0] 1st\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 1st.t\n[master 7a4ca6e] 2nd\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 2nd.t\nok 2 - setup\n\nexpecting success:\ntest_must_fail env MSG=1 GIT_NOTES_REF=/ git notes show &&\ntest_must_fail env MSG=2 GIT_NOTES_REF=/ git notes show\n\nfatal: Refusing to show notes in / (outside of refs/notes/)\nfatal: Refusing to show notes in / (outside of refs/notes/)\nok 3 - need valid notes ref\n\nexpecting success:\ntest_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add\n\nfatal: Refusing to add notes in refs/heads/bogus (outside of refs/notes/)\nok 4 - refusing to add notes in refs/heads/\n\nexpecting success:\ntest_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes edit\n\nfatal: Refusing to edit notes in refs/heads/bogus (outside of refs/notes/)\nok 5 - refusing to edit notes in refs/remotes/\n\nexpecting success:\ntest_expect_code 1 git notes show\n\nerror: No note found for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691.\nok 6 - handle empty notes gracefully\n\nexpecting success:\ntest_write_lines A B >expect &&\ngit show -s --format=\"A%n%NB\" >output &&\ntest_cmp expect output\n\nok 7 - show non-existent notes entry with %N\n\nexpecting success:\nMSG=b4 git notes add &&\ntest_path_is_missing .git/NOTES_EDITMSG &&\ntest \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\ntest \"b4\" = \"$(git notes show)\" &&\ngit show HEAD^ &&\ntest_must_fail git notes show HEAD^\n\nb4\nnot ok 8 - create notes\n#\n# MSG=b4 git notes add &&\n# test_path_is_missing .git/NOTES_EDITMSG &&\n# test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n# test \"b4\" = \"$(git notes show)\" &&\n# git show HEAD^ &&\n# test_must_fail git notes show HEAD^\n#\n\nexpecting success:\ntest_write_lines A b4 B >expect &&\ngit show -s --format=\"A%n%NB\" >output &&\ntest_cmp expect output\n\nok 9 - show notes entry with %N\n\nexpecting success:\ncat <<-EOF >expect &&\na1d8fa6 refs/notes/commits@{0}: notes: Notes added by 'git notes add'\nEOF\ngit reflog show refs/notes/commits >output &&\ntest_cmp expect output\n\nok 10 - create reflog entry\n\nexpecting success:\nMSG=b3 git notes edit &&\ntest_path_is_missing .git/NOTES_EDITMSG &&\ntest \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\ntest \"b3\" = \"$(git notes show)\" &&\ngit show HEAD^ &&\ntest_must_fail git notes show HEAD^\n\nb3\nnot ok 11 - edit existing notes\n#\n# MSG=b3 git notes edit &&\n# test_path_is_missing .git/NOTES_EDITMSG &&\n# test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n# test \"b3\" = \"$(git notes show)\" &&\n# git show HEAD^ &&\n# test_must_fail git notes show HEAD^\n#\n\nexpecting success:\ntest_must_fail git notes add -m \"b2\" &&\ntest_path_is_missing .git/NOTES_EDITMSG &&\ntest \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\ntest \"b3\" = \"$(git notes show)\" &&\ngit show HEAD^ &&\ntest_must_fail git notes show HEAD^\n\nerror: Cannot add notes. Found existing notes for object\n7a4ca6ee52a974a66cbaa78e33214535dff1d691. Use '-f' to overwrite\nexisting notes\nnot ok 12 - cannot \"git notes add -m\" where notes already exists\n#\n# test_must_fail git notes add -m \"b2\" &&\n# test_path_is_missing .git/NOTES_EDITMSG &&\n# test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n# test \"b3\" = \"$(git notes show)\" &&\n# git show HEAD^ &&\n# test_must_fail git notes show HEAD^\n#\n\nexpecting success:\ngit notes add -f -m \"b1\" &&\ntest_path_is_missing .git/NOTES_EDITMSG &&\ntest \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\ntest \"b1\" = \"$(git notes show)\" &&\ngit show HEAD^ &&\ntest_must_fail git notes show HEAD^\n\nOverwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\nnot ok 13 - can overwrite existing note with \"git notes add -f -m\"\n#\n# git notes add -f -m \"b1\" &&\n# test_path_is_missing .git/NOTES_EDITMSG &&\n# test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n# test \"b1\" = \"$(git notes show)\" &&\n# git show HEAD^ &&\n# test_must_fail git notes show HEAD^\n#\n\nexpecting success:\nMSG=b2 git notes add &&\ntest_path_is_missing .git/NOTES_EDITMSG &&\ntest \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\ntest \"b2\" = \"$(git notes show)\" &&\ngit show HEAD^ &&\ntest_must_fail git notes show HEAD^\n\nb2\nnot ok 14 - add w/no options on existing note morphs into edit\n#\n# MSG=b2 git notes add &&\n# test_path_is_missing .git/NOTES_EDITMSG &&\n# test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n# test \"b2\" = \"$(git notes show)\" &&\n# git show HEAD^ &&\n# test_must_fail git notes show HEAD^\n#\n\nexpecting success:\nMSG=b1 git notes add -f &&\ntest_path_is_missing .git/NOTES_EDITMSG &&\ntest \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\ntest \"b1\" = \"$(git notes show)\" &&\ngit show HEAD^ &&\ntest_must_fail git notes show HEAD^\n\nOverwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\nb1\nnot ok 15 - can overwrite existing note with \"git notes add -f\"\n#\n# MSG=b1 git notes add -f &&\n# test_path_is_missing .git/NOTES_EDITMSG &&\n# test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n# test \"b1\" = \"$(git notes show)\" &&\n# git show HEAD^ &&\n# test_must_fail git notes show HEAD^\n#\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 7a4ca6ee52a974a66cbaa78e33214535dff1d691\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:14:13 2005 -0700\n\n${indent}2nd\n\nNotes:\n${indent}b1\nEOF\n! (git cat-file commit HEAD | grep b1) &&\ngit log -1 >output &&\ntest_cmp expect output\n\nok 16 - show notes\n\nexpecting success:\ntest_commit 3rd &&\nMSG=\"b3${LF}c3c3c3c3${LF}d3d3d3\" git notes add &&\ncat >expect-multiline <<-EOF &&\ncommit d07d62e5208f22eb5695e7eb47667dc8b9860290\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:15:13 2005 -0700\n\n${indent}3rd\n\nNotes:\n${indent}b3\n${indent}c3c3c3c3\n${indent}d3d3d3\n\nEOF\ncat expect >>expect-multiline &&\ngit log -2 >output &&\ntest_cmp expect-multiline output\n\n[master d07d62e] 3rd\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 3rd.t\nb3\nc3c3c3c3\nd3d3d3\nok 17 - show multi-line notes\n\nexpecting success:\ntest_commit 4th &&\necho \"xyzzy\" >note5 &&\ngit notes add -F note5 &&\ncat >expect-F <<-EOF &&\ncommit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:16:13 2005 -0700\n\n${indent}4th\n\nNotes:\n${indent}xyzzy\n\nEOF\ncat expect-multiline >>expect-F &&\ngit log -3 >output &&\ntest_cmp expect-F output\n\n[master 0f7aa3e] 4th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 4th.t\nok 18 - show -F notes\n\nexpecting success:\necho \"zyxxy\" >note5 &&\ntest_must_fail git notes add -F note5 &&\ngit log -3 >output &&\ntest_cmp expect-F output\n\nerror: Cannot add notes. Found existing notes for object\n0f7aa3ec6325aeb88b910453bb3eb37c49d75c11. Use '-f' to overwrite\nexisting notes\nok 19 - Re-adding -F notes without -f fails\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\ntree 05ac65288c4c4b3b709a020ae94b2ece2f2201ae\nparent d07d62e5208f22eb5695e7eb47667dc8b9860290\nauthor A U Thor <author@example.com> 1112912173 -0700\ncommitter C O Mitter <committer@example.com> 1112912173 -0700\n\n${indent}4th\nEOF\ngit log -1 --pretty=raw >output &&\ntest_cmp expect output\n\nok 20 - git log --pretty=raw does not show notes\n\nexpecting success:\ncat >>expect <<-EOF &&\n\nNotes:\n${indent}xyzzy\nEOF\ngit log -1 --pretty=raw --show-notes >output &&\ntest_cmp expect output\n\nok 21 - git log --show-notes\n\nexpecting success:\ngit log -1 --no-notes >output &&\n! grep xyzzy output\n\nok 22 - git log --no-notes\n\nexpecting success:\ngit format-patch -1 --stdout >output &&\n! grep xyzzy output\n\nok 23 - git format-patch does not show notes\n\nexpecting success:\ngit format-patch --show-notes -1 --stdout >output &&\ngrep xyzzy output\n\n    xyzzy\nok 24 - git format-patch --show-notes does show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\n    xyzzy\nok 25 - git show  does show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 26 - git show --pretty does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 27 - git show --pretty=raw does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 28 - git show --pretty=short does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 29 - git show --pretty=medium does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 30 - git show --pretty=full does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 31 - git show --pretty=fuller does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 32 - git show --pretty=format:%s does not show notes\n\nexpecting success:\ngit show $p >output &&\neval \"$negate grep xyzzy output\"\n\nok 33 - git show --oneline does not show notes\n\nexpecting success:\ngit notes --ref=alternate add -m alternate\n\nok 34 - setup alternate notes ref\n\nexpecting success:\ngit log -1 --notes >output &&\ngrep xyzzy output &&\n! grep alternate output\n\n    xyzzy\nok 35 - git log --notes shows default notes\n\nexpecting success:\ngit log -1 --notes=alternate >output &&\n! grep xyzzy output &&\ngrep alternate output\n\nNotes (alternate):\n    alternate\nok 36 - git log --notes=X shows only X\n\nexpecting success:\ngit log -1 --notes --notes=alternate >output &&\ngrep xyzzy output &&\ngrep alternate output\n\n    xyzzy\nNotes (alternate):\n    alternate\nok 37 - git log --notes --notes=X shows both\n\nexpecting success:\ngit log -1 --notes --notes=alternate \\\n--no-notes --notes=alternate \\\n>output &&\n! grep xyzzy output &&\ngrep alternate output\n\nNotes (alternate):\n    alternate\nok 38 - git log --no-notes resets default state\n\nexpecting success:\ngit log -1 --notes --notes=alternate \\\n--no-notes --notes \\\n>output &&\ngrep xyzzy output &&\n! grep alternate output\n\n    xyzzy\nok 39 - git log --no-notes resets ref list\n\nexpecting success:\ntest_commit 5th &&\ngit notes add -m spam -m \"foo${LF}bar${LF}baz\" &&\ncat >expect-m <<-EOF &&\ncommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:17:13 2005 -0700\n\n${indent}5th\n\nNotes:\n${indent}spam\n${indent}\n${indent}foo\n${indent}bar\n${indent}baz\n\nEOF\ncat expect-F >>expect-m &&\ngit log -4 >output &&\ntest_cmp expect-m output\n\n[master 7f9ad88] 5th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 5th.t\nok 40 - show -m notes\n\nexpecting success:\ngit notes add -f -F /dev/null &&\ncat >expect-rm-F <<-EOF &&\ncommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:17:13 2005 -0700\n\n${indent}5th\n\nEOF\ncat expect-F >>expect-rm-F &&\ngit log -4 >output &&\ntest_cmp expect-rm-F output &&\ntest_must_fail git notes show\n\nOverwriting existing notes for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nRemoving note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nerror: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\nok 41 - remove note with add -f -F /dev/null\n\nexpecting success:\ngit notes add -m \"\" &&\ngit log -4 >output &&\ntest_cmp expect-rm-F output &&\ntest_must_fail git notes show\n\nRemoving note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nerror: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\nok 42 - do not create empty note with -m \"\"\n\nexpecting success:\ncat >expect-combine_m_and_F <<-EOF &&\nfoo\n\nxyzzy\n\nbar\n\nzyxxy\n\nbaz\nEOF\necho \"xyzzy\" >note_a &&\necho \"zyxxy\" >note_b &&\ngit notes add -m \"foo\" -F note_a -m \"bar\" -F note_b -m \"baz\" &&\ngit notes show >output &&\ntest_cmp expect-combine_m_and_F output\n\nok 43 - create note with combination of -m and -F\n\nexpecting success:\ngit notes remove HEAD^ &&\ngit notes remove &&\ncat >expect-rm-remove <<-EOF &&\ncommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:17:13 2005 -0700\n\n${indent}5th\n\ncommit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:16:13 2005 -0700\n\n${indent}4th\n\nEOF\ncat expect-multiline >>expect-rm-remove &&\ngit log -4 >output &&\ntest_cmp expect-rm-remove output &&\ntest_must_fail git notes show HEAD^\n\nRemoving note for object HEAD^\nRemoving note for object HEAD\nerror: No note found for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11.\nok 44 - remove note with \"git notes remove\"\n\nexpecting success:\ngit rev-parse --verify refs/notes/commits >before_commit &&\ntest_must_fail git notes remove HEAD^ &&\ngit rev-parse --verify refs/notes/commits >after_commit &&\ntest_cmp before_commit after_commit\n\nObject HEAD^ has no note\nok 45 - removing non-existing note should not create new commit\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\n\n# We have only two -- add another and make sure it stays\ngit notes add -m \"extra\" &&\ngit notes list HEAD >after-removal-expect &&\ngit notes remove HEAD^^ HEAD^^^ &&\ngit notes list | sed -e \"s/ .*//\" >actual &&\ntest_cmp after-removal-expect actual\n\nRemoving note for object HEAD^^\nRemoving note for object HEAD^^^\nok 46 - removing more than one\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\ntest_must_fail git notes remove HEAD^^ HEAD^^^ HEAD^ &&\nafter=$(git rev-parse --verify refs/notes/commits) &&\ntest \"$before\" = \"$after\"\n\nRemoving note for object HEAD^^\nRemoving note for object HEAD^^^\nObject HEAD^ has no note\nok 47 - removing is atomic\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\n\n# We have only two -- add another and make sure it stays\ngit notes add -m \"extra\" &&\ngit notes list HEAD >after-removal-expect &&\ngit notes remove --ignore-missing HEAD^^ HEAD^^^ HEAD^ &&\ngit notes list | sed -e \"s/ .*//\" >actual &&\ntest_cmp after-removal-expect actual\n\nRemoving note for object HEAD^^\nRemoving note for object HEAD^^^\nObject HEAD^ has no note\nok 48 - removing with --ignore-missing\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\ntest_must_fail git notes remove --ignore-missing HEAD^^ HEAD^^^\nNO-SUCH-COMMIT &&\nafter=$(git rev-parse --verify refs/notes/commits) &&\ntest \"$before\" = \"$after\"\n\nRemoving note for object HEAD^^\nRemoving note for object HEAD^^^\nerror: Failed to resolve 'NO-SUCH-COMMIT' as a valid ref.\nok 49 - removing with --ignore-missing but bogus ref\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\n\n# We have only two -- add another and make sure it stays\ngit notes add -m \"extra\" &&\ngit notes list HEAD >after-removal-expect &&\ngit rev-parse HEAD^^ HEAD^^^ >input &&\ngit notes remove --stdin <input &&\ngit notes list | sed -e \"s/ .*//\" >actual &&\ntest_cmp after-removal-expect actual\n\nRemoving note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\nRemoving note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\nok 50 - remove reads from --stdin\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\ngit rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\ntest_must_fail git notes remove --stdin <input &&\nafter=$(git rev-parse --verify refs/notes/commits) &&\ntest \"$before\" = \"$after\"\n\nRemoving note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\nRemoving note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\nObject 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note\nok 51 - remove --stdin is also atomic\n\nexpecting success:\nbefore=$(git rev-parse --verify refs/notes/commits) &&\ntest_when_finished \"git update-ref refs/notes/commits $before\" &&\n\n# We have only two -- add another and make sure it stays\ngit notes add -m \"extra\" &&\ngit notes list HEAD >after-removal-expect &&\ngit rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\ngit notes remove --ignore-missing --stdin <input &&\ngit notes list | sed -e \"s/ .*//\" >actual &&\ntest_cmp after-removal-expect actual\n\nRemoving note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\nRemoving note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\nObject 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note\nok 52 - removing with --stdin --ignore-missing\n\nexpecting success:\ncat >expect <<-EOF &&\nc9c6af7f78bc47490dbf3e822cf2f3c24d4b9061\n7a4ca6ee52a974a66cbaa78e33214535dff1d691\nc18dc024e14f08d18d14eea0d747ff692d66d6a3\nd07d62e5208f22eb5695e7eb47667dc8b9860290\nEOF\ngit notes list >output &&\ntest_cmp expect output\n\nok 53 - list notes with \"git notes list\"\n\nexpecting success:\ngit notes >output &&\ntest_cmp expect output\n\nok 54 - list notes with \"git notes\"\n\nexpecting success:\ncat >expect <<-EOF &&\nc18dc024e14f08d18d14eea0d747ff692d66d6a3\nEOF\ngit notes list HEAD^^ >output &&\ntest_cmp expect output\n\nok 55 - list specific note with \"git notes list <object>\"\n\nexpecting success:\ncat >expect <<-EOF &&\nEOF\ntest_must_fail git notes list HEAD >output &&\ntest_cmp expect output\n\nerror: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\nok 56 - listing non-existing notes fails\n\nexpecting success:\ncat >expect <<-EOF &&\nInitial set of notes\n\nMore notes appended with git notes append\nEOF\ngit notes add -m \"Initial set of notes\" &&\ngit notes append -m \"More notes appended with git notes append\" &&\ngit notes show >output &&\ntest_cmp expect output\n\nok 57 - append to existing note with \"git notes append\"\n\nexpecting success:\ncat >expect_list <<-EOF &&\nc9c6af7f78bc47490dbf3e822cf2f3c24d4b9061\n7a4ca6ee52a974a66cbaa78e33214535dff1d691\n4b6ad22357cc8a1296720574b8d2fbc22fab0671\n7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nc18dc024e14f08d18d14eea0d747ff692d66d6a3\nd07d62e5208f22eb5695e7eb47667dc8b9860290\nEOF\ngit notes list >output &&\ntest_cmp expect_list output\n\nok 58 - \"git notes list\" does not expand to \"git notes list HEAD\"\n\nexpecting success:\ngit notes append -m \"\" &&\ngit notes show >output &&\ntest_cmp expect output\n\nok 59 - appending empty string does not change existing note\n\nexpecting success:\ngit notes remove HEAD &&\ntest_must_fail git notes list HEAD &&\ngit notes append -m \"Initial set of notes${LF}${LF}More notes appended\nwith git notes append\" &&\ngit notes show >output &&\ntest_cmp expect output\n\nRemoving note for object HEAD\nerror: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\nok 60 - git notes append == add when there is no existing note\n\nexpecting success:\ngit notes remove HEAD &&\ntest_must_fail git notes list HEAD &&\ngit notes append -m \"\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nerror: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\nRemoving note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nerror: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\nok 61 - appending empty string to non-existing note does not create note\n\nexpecting success:\ntest_commit 6th &&\nGIT_NOTES_REF=\"refs/notes/other\" git notes add -m \"other note\" &&\ncat >expect-not-other <<-EOF &&\ncommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:18:13 2005 -0700\n\n${indent}6th\nEOF\ncp expect-not-other expect-other &&\ncat >>expect-other <<-EOF\n\nNotes (other):\n${indent}other note\nEOF\n\n[master 2c12533] 6th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 6th.t\nok 62 - create other note on a different notes ref (setup)\n\nexpecting success:\ngit log -1 >output &&\ntest_cmp expect-not-other output\n\nok 63 - Do not show note on other ref by default\n\nexpecting success:\nGIT_NOTES_REF=\"refs/notes/other\" git log -1 >output &&\ntest_cmp expect-other output\n\nok 64 - Do show note when ref is given in GIT_NOTES_REF\n\nexpecting success:\ntest_config core.notesRef \"refs/notes/other\" &&\ngit log -1 >output &&\ntest_cmp expect-other output\n\nok 65 - Do show note when ref is given in core.notesRef config\n\nexpecting success:\ntest_config core.notesRef \"refs/notes/other\" &&\nGIT_NOTES_REF=\"refs/notes/wrong\" git log -1 >output &&\ntest_cmp expect-not-other output\n\nok 66 - Do not show note when core.notesRef is overridden\n\nexpecting success:\ncat >expect-both <<-EOF &&\ncommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:18:13 2005 -0700\n\n${indent}6th\n\nNotes:\n${indent}order test\n\nNotes (other):\n${indent}other note\n\ncommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:17:13 2005 -0700\n\n${indent}5th\n\nNotes:\n${indent}replacement for deleted note\nEOF\nGIT_NOTES_REF=refs/notes/commits git notes add \\\n-m\"replacement for deleted note\" HEAD^ &&\nGIT_NOTES_REF=refs/notes/commits git notes add -m\"order test\" &&\ntest_unconfig core.notesRef &&\ntest_config notes.displayRef \"refs/notes/*\" &&\ngit log -2 >output &&\ntest_cmp expect-both output\n\nok 67 - Show all notes when notes.displayRef=refs/notes/*\n\nexpecting success:\ntest_config core.notesRef refs/notes/commits &&\ntest_config notes.displayRef refs/notes/other &&\ngit log -2 >output &&\ntest_cmp expect-both output\n\nok 68 - core.notesRef is implicitly in notes.displayRef\n\nexpecting success:\ntest_unconfig core.notesRef &&\ntest_config notes.displayRef refs/notes/commits &&\ngit config --add notes.displayRef refs/notes/other &&\ngit log -2 >output &&\ntest_cmp expect-both output\n\nok 69 - notes.displayRef can be given more than once\n\nexpecting success:\ncat >expect-both-reversed <<-EOF &&\ncommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:18:13 2005 -0700\n\n${indent}6th\n\nNotes (other):\n${indent}other note\n\nNotes:\n${indent}order test\nEOF\ntest_config core.notesRef refs/notes/other &&\ntest_config notes.displayRef refs/notes/commits &&\ngit log -1 >output &&\ntest_cmp expect-both-reversed output\n\nok 70 - notes.displayRef respects order\n\nexpecting success:\nGIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\ngit log -2 >output &&\ntest_cmp expect-both output\n\nok 71 - GIT_NOTES_DISPLAY_REF works\n\nexpecting success:\ncat >expect-none <<-EOF &&\ncommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:18:13 2005 -0700\n\n${indent}6th\n\ncommit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:17:13 2005 -0700\n\n${indent}5th\nEOF\ntest_config notes.displayRef \"refs/notes/*\" &&\nGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >output &&\ntest_cmp expect-none output\n\nok 72 - GIT_NOTES_DISPLAY_REF overrides config\n\nexpecting success:\nGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >output &&\ntest_cmp expect-both output\n\nok 73 - --show-notes=* adds to GIT_NOTES_DISPLAY_REF\n\nexpecting success:\ncat >expect-commits <<EOF\ncommit 2c125331118caba0ff8238b7f4958ac6e93fe39c\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:18:13 2005 -0700\n\n${indent}6th\n\nNotes:\n${indent}order test\nEOF\ngit log --no-standard-notes --show-notes=commits -1 >output &&\ntest_cmp expect-commits output\n\nok 74 - --no-standard-notes\n\nexpecting success:\ntest_config notes.displayRef \"refs/notes/*\" &&\ngit log --no-standard-notes --show-notes=commits \\\n--standard-notes -2 >output &&\ntest_cmp expect-both output\n\nok 75 - --standard-notes\n\nexpecting success:\ngit log --show-notes=other --show-notes=commits \\\n--no-standard-notes -1 >output &&\ntest_cmp expect-both-reversed output\n\nok 76 - --show-notes=ref accumulates\n\nexpecting success:\ntest_config core.notesRef refs/notes/other &&\necho \"Note on a tree\" >expect &&\ngit notes add -m \"Note on a tree\" HEAD: &&\ngit notes show HEAD: >actual &&\ntest_cmp expect actual &&\necho \"Note on a blob\" >expect &&\nfilename=$(git ls-tree --name-only HEAD | head -n1) &&\ngit notes add -m \"Note on a blob\" HEAD:$filename &&\ngit notes show HEAD:$filename >actual &&\ntest_cmp expect actual &&\necho \"Note on a tag\" >expect &&\ngit tag -a -m \"This is an annotated tag\" foobar HEAD^ &&\ngit notes add -m \"Note on a tag\" foobar &&\ngit notes show foobar >actual &&\ntest_cmp expect actual\n\nok 77 - Allow notes on non-commits (trees, blobs, tags)\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit fb01e0ca8c33b6cc0c6451dde747f97df567cb5c\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:19:13 2005 -0700\n\n${indent}7th\n\nNotes:\n${indent}order test\nEOF\ntest_commit 7th &&\ngit notes add -C $(git notes list HEAD^) &&\ngit log -1 >actual &&\ntest_cmp expect actual &&\ntest \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n\n[master fb01e0c] 7th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 7th.t\nok 78 - create note from other note with \"git notes add -C\"\n\nexpecting success:\ntest_commit 8th &&\ntest_must_fail git notes add -C deadbeef &&\ntest_must_fail git notes list HEAD\n\n[master 9a4c31c] 8th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 8th.t\nfatal: Failed to resolve 'deadbeef' as a valid ref.\nerror: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.\nok 79 - create note from non-existing note with \"git notes add -C\" fails\n\nexpecting success:\ncommit=$(git rev-parse --verify HEAD) &&\ntree=$(git rev-parse --verify HEAD:) &&\ntest_must_fail git notes add -C $commit &&\ntest_must_fail git notes add -C $tree &&\ntest_must_fail git notes list HEAD\n\nfatal: Cannot read note data from non-blob object\n'9a4c31c7f722b5d517e92c64e932dd751e1413bf'.\nfatal: Cannot read note data from non-blob object\n'37f6454412e4ed89ae47782f956ed0fb573892f6'.\nerror: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.\nok 80 - create note from non-blob with \"git notes add -C\" fails\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 9a4c31c7f722b5d517e92c64e932dd751e1413bf\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:20:13 2005 -0700\n\n${indent}8th\n\nNotes:\n${indent}This is a blob object\nEOF\nblob=$(echo \"This is a blob object\" | git hash-object -w --stdin) &&\ngit notes add -C $blob &&\ngit log -1 >actual &&\ntest_cmp expect actual &&\ntest \"$(git notes list HEAD)\" = \"$blob\"\n\nok 81 - create note from blob with \"git notes add -C\" reuses blob id\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:21:13 2005 -0700\n\n${indent}9th\n\nNotes:\n${indent}yet another note\nEOF\ntest_commit 9th &&\nMSG=\"yet another note\" git notes add -c $(git notes list HEAD^^) &&\ngit log -1 >actual &&\ntest_cmp expect actual\n\n[master 2e0db4b] 9th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 9th.t\nyet another note\nok 82 - create note from other note with \"git notes add -c\"\n\nexpecting success:\ntest_commit 10th &&\ntest_must_fail env MSG=\"yet another note\" git notes add -c deadbeef &&\ntest_must_fail git notes list HEAD\n\n[master 7c3b87a] 10th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 10th.t\nfatal: Failed to resolve 'deadbeef' as a valid ref.\nerror: No note found for object 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406.\nok 83 - create note from non-existing note with \"git notes add -c\" fails\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:21:13 2005 -0700\n\n${indent}9th\n\nNotes:\n${indent}yet another note\n${indent}\n${indent}yet another note\nEOF\ngit notes append -C $(git notes list HEAD^) HEAD^ &&\ngit log -1 HEAD^ >actual &&\ntest_cmp expect actual\n\nok 84 - append to note from other note with \"git notes append -C\"\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:22:13 2005 -0700\n\n${indent}10th\n\nNotes:\n${indent}other note\nEOF\nMSG=\"other note\" git notes append -c $(git notes list HEAD^) &&\ngit log -1 >actual &&\ntest_cmp expect actual\n\nother note\nok 85 - create note from other note with \"git notes append -c\"\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:22:13 2005 -0700\n\n${indent}10th\n\nNotes:\n${indent}other note\n${indent}\n${indent}yet another note\nEOF\nMSG=\"yet another note\" git notes append -c $(git notes list HEAD) &&\ngit log -1 >actual &&\ntest_cmp expect actual\n\nyet another note\nok 86 - append to note from other note with \"git notes append -c\"\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:23:13 2005 -0700\n\n${indent}11th\n\nNotes:\n${indent}other note\n${indent}\n${indent}yet another note\nEOF\ntest_commit 11th &&\ngit notes copy HEAD^ HEAD &&\ngit log -1 >actual &&\ntest_cmp expect actual &&\ntest \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n\n[master a446fff] 11th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 11th.t\nok 87 - copy note with \"git notes copy\"\n\nexpecting success:\ntest_must_fail git notes copy HEAD~2 HEAD &&\ngit log -1 >actual &&\ntest_cmp expect actual &&\ntest \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n\nerror: Cannot copy notes. Found existing notes for object\na446fff8777efdc6eb8f4b7c8a5ff699484df0d5. Use '-f' to overwrite\nexisting notes\nok 88 - prevent overwrite with \"git notes copy\"\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:23:13 2005 -0700\n\n${indent}11th\n\nNotes:\n${indent}yet another note\n${indent}\n${indent}yet another note\nEOF\ngit notes copy -f HEAD~2 HEAD &&\ngit log -1 >actual &&\ntest_cmp expect actual &&\ntest \"$(git notes list HEAD)\" = \"$(git notes list HEAD~2)\"\n\nOverwriting existing notes for object a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\nok 89 - allow overwrite with \"git notes copy -f\"\n\nexpecting success:\ntest_commit 12th &&\ntest_commit 13th &&\ntest_must_fail git notes copy HEAD^ HEAD\n\n[master 65e263d] 12th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 12th.t\n[master e871aa6] 13th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 13th.t\nerror: Missing notes on source object\n65e263ded02ae4e8839bc151095113737579dc12. Cannot copy.\nok 90 - cannot copy note from object without notes\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit e871aa61182b1d95d0a6fb75445d891722863b6b\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:25:13 2005 -0700\n\n${indent}13th\n\nNotes:\n${indent}yet another note\n${indent}\n${indent}yet another note\n\ncommit 65e263ded02ae4e8839bc151095113737579dc12\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:24:13 2005 -0700\n\n${indent}12th\n\nNotes:\n${indent}other note\n${indent}\n${indent}yet another note\nEOF\n(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\necho $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\ngit notes copy --stdin &&\ngit log -2 >output &&\ntest_cmp expect output &&\ntest \"$(git notes list HEAD)\" = \"$(git notes list HEAD~2)\" &&\ntest \"$(git notes list HEAD^)\" = \"$(git notes list HEAD~3)\"\n\nok 91 - git notes copy --stdin\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\ncommit 07c85d77059393ed0154b8c96906547a59dfcddd\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:26:13 2005 -0700\n\n${indent}14th\nEOF\ntest_commit 14th &&\ntest_commit 15th &&\n(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\necho $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\ngit notes copy --for-rewrite=foo &&\ngit log -2 >output &&\ntest_cmp expect output\n\n[master 07c85d7] 14th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 14th.t\n[master 4acf42e] 15th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 15th.t\nok 92 - git notes copy --for-rewrite (unconfigured)\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\nNotes:\n${indent}yet another note\n${indent}\n${indent}yet another note\n\ncommit 07c85d77059393ed0154b8c96906547a59dfcddd\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:26:13 2005 -0700\n\n${indent}14th\n\nNotes:\n${indent}other note\n${indent}\n${indent}yet another note\nEOF\ntest_config notes.rewriteMode overwrite &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\n(echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\necho $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\ngit notes copy --for-rewrite=foo &&\ngit log -2 >output &&\ntest_cmp expect output\n\nok 93 - git notes copy --for-rewrite (enabled)\n\nexpecting success:\ntest_config notes.rewrite.bar false &&\necho $(git rev-parse HEAD~3) $(git rev-parse HEAD) |\ngit notes copy --for-rewrite=bar &&\ngit log -2 >output &&\ntest_cmp expect output\n\n./test-lib.sh: line 536: echo: write error: Broken pipe\nok 94 - git notes copy --for-rewrite (disabled)\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\nNotes:\n${indent}a fresh note\nEOF\ngit notes add -f -m\"a fresh note\" HEAD^ &&\ntest_config notes.rewriteMode overwrite &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\ngit notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nOverwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\nok 95 - git notes copy --for-rewrite (overwrite)\n\nexpecting success:\ntest_config notes.rewriteMode ignore &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\ngit notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nok 96 - git notes copy --for-rewrite (ignore)\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\nNotes:\n${indent}a fresh note\n${indent}\n${indent}another fresh note\nEOF\ngit notes add -f -m\"another fresh note\" HEAD^ &&\ntest_config notes.rewriteMode concatenate &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\ngit notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nOverwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\nok 97 - git notes copy --for-rewrite (append)\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\nNotes:\n${indent}a fresh note\n${indent}\n${indent}another fresh note\n${indent}\n${indent}append 1\n${indent}\n${indent}append 2\nEOF\ngit notes add -f -m\"append 1\" HEAD^ &&\ngit notes add -f -m\"append 2\" HEAD^^ &&\ntest_config notes.rewriteMode concatenate &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\n(echo $(git rev-parse HEAD^) $(git rev-parse HEAD);\necho $(git rev-parse HEAD^^) $(git rev-parse HEAD)) |\ngit notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nOverwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\nOverwriting existing notes for object e871aa61182b1d95d0a6fb75445d891722863b6b\nok 98 - git notes copy --for-rewrite (append two to one)\n\nexpecting success:\ngit notes remove HEAD^ &&\ntest_config notes.rewriteMode concatenate &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\ngit notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nRemoving note for object HEAD^\nok 99 - git notes copy --for-rewrite (append empty)\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\nNotes:\n${indent}replacement note 1\nEOF\ntest_config notes.rewriteMode concatenate &&\ntest_config notes.rewriteRef \"refs/notes/*\" &&\ngit notes add -f -m\"replacement note 1\" HEAD^ &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\nGIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nok 100 - GIT_NOTES_REWRITE_MODE works\n\nexpecting success:\ncat >expect <<-EOF &&\ncommit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:27:13 2005 -0700\n\n${indent}15th\n\nNotes:\n${indent}replacement note 2\nEOF\ngit notes add -f -m\"replacement note 2\" HEAD^ &&\ntest_config notes.rewriteMode overwrite &&\ntest_unconfig notes.rewriteRef &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\nGIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \\\ngit notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nOverwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\nok 101 - GIT_NOTES_REWRITE_REF works\n\nexpecting success:\ngit notes add -f -m\"replacement note 3\" HEAD^ &&\ntest_config notes.rewriteMode overwrite &&\ntest_config notes.rewriteRef refs/notes/other &&\necho $(git rev-parse HEAD^) $(git rev-parse HEAD) |\nGIT_NOTES_REWRITE_REF= git notes copy --for-rewrite=foo &&\ngit log -1 >output &&\ntest_cmp expect output\n\nOverwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n./test-lib.sh: line 538: echo: write error: Broken pipe\nok 102 - GIT_NOTES_REWRITE_REF overrides config\n\nexpecting success:\ntest_must_fail git notes copy &&\ntest_must_fail git notes copy one two three\n\nerror: too few parameters\nusage: git notes copy [<options>] <from-object> <to-object>\n   or: git notes copy --stdin [<from-object> <to-object>]...\n\n    -f, --force           replace existing notes\n    --stdin               read objects from stdin\n    --for-rewrite <command>\n                          load rewriting config for <command> (implies --stdin)\n\nerror: too many parameters\nusage: git notes copy [<options>] <from-object> <to-object>\n   or: git notes copy --stdin [<from-object> <to-object>]...\n\n    -f, --force           replace existing notes\n    --stdin               read objects from stdin\n    --for-rewrite <command>\n                          load rewriting config for <command> (implies --stdin)\n\nok 103 - git notes copy diagnoses too many or too few parameters\n\nexpecting success:\ntest_unconfig core.notesRef &&\nsane_unset GIT_NOTES_REF &&\ntest \"$(git notes get-ref)\" = \"refs/notes/commits\"\n\nok 104 - git notes get-ref (no overrides)\n\nexpecting success:\ntest_config core.notesRef refs/notes/foo &&\ntest \"$(git notes get-ref)\" = \"refs/notes/foo\"\n\nok 105 - git notes get-ref (core.notesRef)\n\nexpecting success:\ntest \"$(GIT_NOTES_REF=refs/notes/bar git notes get-ref)\" = \"refs/notes/bar\"\n\nok 106 - git notes get-ref (GIT_NOTES_REF)\n\nexpecting success:\ntest \"$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)\" =\n\"refs/notes/baz\"\n\nok 107 - git notes get-ref (--ref)\n\nexpecting success:\ntest_unconfig core.notesRef &&\ntest_commit 16th &&\nempty_blob=$(git hash-object -w /dev/null) &&\necho \"$empty_blob\" >expect_empty\n\n[master 21d0abc] 16th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 16th.t\nok 108 - setup testing of empty notes\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add &&\ntest_must_fail git notes list HEAD\n\nObject HEAD has no note\n\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 109 - 'git notes add' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\n\nok 110 - 'git notes add --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -F /dev/null &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 111 - 'git notes add -F /dev/null' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -F /dev/null --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\nok 112 - 'git notes add -F /dev/null --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -m \"\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 113 - 'git notes add -m \"\"' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -m \"\" --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\nok 114 - 'git notes add -m \"\" --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -c \"$empty_blob\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\n\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 115 - 'git notes add -c \"$empty_blob\"' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -c \"$empty_blob\" --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\n\nok 116 - 'git notes add -c \"$empty_blob\" --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -C \"$empty_blob\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 117 - 'git notes add -C \"$empty_blob\"' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes add -C \"$empty_blob\" --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\nok 118 - 'git notes add -C \"$empty_blob\" --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\n\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 119 - 'git notes append' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\n\nok 120 - 'git notes append --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -F /dev/null &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 121 - 'git notes append -F /dev/null' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -F /dev/null --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\nok 122 - 'git notes append -F /dev/null --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -m \"\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 123 - 'git notes append -m \"\"' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -m \"\" --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\nok 124 - 'git notes append -m \"\" --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -c \"$empty_blob\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\n\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 125 - 'git notes append -c \"$empty_blob\"' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -c \"$empty_blob\" --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\n\nok 126 - 'git notes append -c \"$empty_blob\" --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -C \"$empty_blob\" &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 127 - 'git notes append -C \"$empty_blob\"' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes append -C \"$empty_blob\" --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\nok 128 - 'git notes append -C \"$empty_blob\" --allow-empty' stores empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes edit &&\ntest_must_fail git notes list HEAD\n\nRemoving note for object HEAD\n\nRemoving note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\nerror: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\nok 129 - 'git notes edit' removes empty note\n\nexpecting success:\ntest_might_fail git notes remove HEAD &&\nMSG= git notes edit --allow-empty &&\ngit notes list HEAD >actual &&\ntest_cmp expect_empty actual\n\nObject HEAD has no note\n\nok 130 - 'git notes edit --allow-empty' stores empty note\n\nexpecting success:\ntest_commit 17th &&\ngit log -1 >expect &&\ncat >>expect <<-EOF &&\n\nNotes:\nEOF\ngit notes add -C \"$empty_blob\" --allow-empty &&\ngit log -1 >actual &&\ntest_cmp expect actual\n\n[master 27a79f3] 17th\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 17th.t\nok 131 - empty notes are displayed by git log\n\n# failed 6 among 131 test(s)\n1..131\n"},{"id":"251698","messageId":"CAO2U3QgS+wDSSn0X1ThHtjLbuJJ7NTBMyJG6rUvHe+UFbibNdw@mail.gmail.com","threadId":"37929","inReplyTo":"CAO2U3QhiWVvVKivBhE5R2xhjf8SPPtg6VSaQMxw7vbm_454jBQ@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Michael Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-11T00:23:38Z","receivedAt":"2014-11-11T00:23:38Z","isPatch":false,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"(to be clear: I ran git bisect, and traced the problem to the modernize commit)\n\nOn Mon, Nov 10, 2014 at 4:17 PM, Michael Blume <blume.mike@gmail.com> wrote:\n> the commit modernizing test 3301\n> (https://github.com/git/git/commit/fbe4f74865acfd) appears to break it\n> on my mac\n>\n> Verbose output follows:\n>\n> $ ./t3301-notes.sh -v\n> Initialized empty Git repository in\n> /Users/michael.blume/workspace/git/t/trash directory.t3301-notes/.git/\n> expecting success:\n> test_must_fail env MSG=3 git notes add\n>\n> fatal: Failed to resolve 'HEAD' as a valid ref.\n> ok 1 - cannot annotate non-existing HEAD\n>\n> expecting success:\n> test_commit 1st &&\n> test_commit 2nd\n>\n> [master (root-commit) 04ed9a0] 1st\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 1st.t\n> [master 7a4ca6e] 2nd\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 2nd.t\n> ok 2 - setup\n>\n> expecting success:\n> test_must_fail env MSG=1 GIT_NOTES_REF=/ git notes show &&\n> test_must_fail env MSG=2 GIT_NOTES_REF=/ git notes show\n>\n> fatal: Refusing to show notes in / (outside of refs/notes/)\n> fatal: Refusing to show notes in / (outside of refs/notes/)\n> ok 3 - need valid notes ref\n>\n> expecting success:\n> test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add\n>\n> fatal: Refusing to add notes in refs/heads/bogus (outside of refs/notes/)\n> ok 4 - refusing to add notes in refs/heads/\n>\n> expecting success:\n> test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes edit\n>\n> fatal: Refusing to edit notes in refs/heads/bogus (outside of refs/notes/)\n> ok 5 - refusing to edit notes in refs/remotes/\n>\n> expecting success:\n> test_expect_code 1 git notes show\n>\n> error: No note found for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691.\n> ok 6 - handle empty notes gracefully\n>\n> expecting success:\n> test_write_lines A B >expect &&\n> git show -s --format=\"A%n%NB\" >output &&\n> test_cmp expect output\n>\n> ok 7 - show non-existent notes entry with %N\n>\n> expecting success:\n> MSG=b4 git notes add &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b4\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> b4\n> not ok 8 - create notes\n> #\n> # MSG=b4 git notes add &&\n> # test_path_is_missing .git/NOTES_EDITMSG &&\n> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> # test \"b4\" = \"$(git notes show)\" &&\n> # git show HEAD^ &&\n> # test_must_fail git notes show HEAD^\n> #\n>\n> expecting success:\n> test_write_lines A b4 B >expect &&\n> git show -s --format=\"A%n%NB\" >output &&\n> test_cmp expect output\n>\n> ok 9 - show notes entry with %N\n>\n> expecting success:\n> cat <<-EOF >expect &&\n> a1d8fa6 refs/notes/commits@{0}: notes: Notes added by 'git notes add'\n> EOF\n> git reflog show refs/notes/commits >output &&\n> test_cmp expect output\n>\n> ok 10 - create reflog entry\n>\n> expecting success:\n> MSG=b3 git notes edit &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b3\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> b3\n> not ok 11 - edit existing notes\n> #\n> # MSG=b3 git notes edit &&\n> # test_path_is_missing .git/NOTES_EDITMSG &&\n> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> # test \"b3\" = \"$(git notes show)\" &&\n> # git show HEAD^ &&\n> # test_must_fail git notes show HEAD^\n> #\n>\n> expecting success:\n> test_must_fail git notes add -m \"b2\" &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b3\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> error: Cannot add notes. Found existing notes for object\n> 7a4ca6ee52a974a66cbaa78e33214535dff1d691. Use '-f' to overwrite\n> existing notes\n> not ok 12 - cannot \"git notes add -m\" where notes already exists\n> #\n> # test_must_fail git notes add -m \"b2\" &&\n> # test_path_is_missing .git/NOTES_EDITMSG &&\n> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> # test \"b3\" = \"$(git notes show)\" &&\n> # git show HEAD^ &&\n> # test_must_fail git notes show HEAD^\n> #\n>\n> expecting success:\n> git notes add -f -m \"b1\" &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b1\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> not ok 13 - can overwrite existing note with \"git notes add -f -m\"\n> #\n> # git notes add -f -m \"b1\" &&\n> # test_path_is_missing .git/NOTES_EDITMSG &&\n> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> # test \"b1\" = \"$(git notes show)\" &&\n> # git show HEAD^ &&\n> # test_must_fail git notes show HEAD^\n> #\n>\n> expecting success:\n> MSG=b2 git notes add &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b2\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> b2\n> not ok 14 - add w/no options on existing note morphs into edit\n> #\n> # MSG=b2 git notes add &&\n> # test_path_is_missing .git/NOTES_EDITMSG &&\n> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> # test \"b2\" = \"$(git notes show)\" &&\n> # git show HEAD^ &&\n> # test_must_fail git notes show HEAD^\n> #\n>\n> expecting success:\n> MSG=b1 git notes add -f &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b1\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> b1\n> not ok 15 - can overwrite existing note with \"git notes add -f\"\n> #\n> # MSG=b1 git notes add -f &&\n> # test_path_is_missing .git/NOTES_EDITMSG &&\n> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> # test \"b1\" = \"$(git notes show)\" &&\n> # git show HEAD^ &&\n> # test_must_fail git notes show HEAD^\n> #\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:14:13 2005 -0700\n>\n> ${indent}2nd\n>\n> Notes:\n> ${indent}b1\n> EOF\n> ! (git cat-file commit HEAD | grep b1) &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> ok 16 - show notes\n>\n> expecting success:\n> test_commit 3rd &&\n> MSG=\"b3${LF}c3c3c3c3${LF}d3d3d3\" git notes add &&\n> cat >expect-multiline <<-EOF &&\n> commit d07d62e5208f22eb5695e7eb47667dc8b9860290\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:15:13 2005 -0700\n>\n> ${indent}3rd\n>\n> Notes:\n> ${indent}b3\n> ${indent}c3c3c3c3\n> ${indent}d3d3d3\n>\n> EOF\n> cat expect >>expect-multiline &&\n> git log -2 >output &&\n> test_cmp expect-multiline output\n>\n> [master d07d62e] 3rd\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 3rd.t\n> b3\n> c3c3c3c3\n> d3d3d3\n> ok 17 - show multi-line notes\n>\n> expecting success:\n> test_commit 4th &&\n> echo \"xyzzy\" >note5 &&\n> git notes add -F note5 &&\n> cat >expect-F <<-EOF &&\n> commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:16:13 2005 -0700\n>\n> ${indent}4th\n>\n> Notes:\n> ${indent}xyzzy\n>\n> EOF\n> cat expect-multiline >>expect-F &&\n> git log -3 >output &&\n> test_cmp expect-F output\n>\n> [master 0f7aa3e] 4th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 4th.t\n> ok 18 - show -F notes\n>\n> expecting success:\n> echo \"zyxxy\" >note5 &&\n> test_must_fail git notes add -F note5 &&\n> git log -3 >output &&\n> test_cmp expect-F output\n>\n> error: Cannot add notes. Found existing notes for object\n> 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11. Use '-f' to overwrite\n> existing notes\n> ok 19 - Re-adding -F notes without -f fails\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n> tree 05ac65288c4c4b3b709a020ae94b2ece2f2201ae\n> parent d07d62e5208f22eb5695e7eb47667dc8b9860290\n> author A U Thor <author@example.com> 1112912173 -0700\n> committer C O Mitter <committer@example.com> 1112912173 -0700\n>\n> ${indent}4th\n> EOF\n> git log -1 --pretty=raw >output &&\n> test_cmp expect output\n>\n> ok 20 - git log --pretty=raw does not show notes\n>\n> expecting success:\n> cat >>expect <<-EOF &&\n>\n> Notes:\n> ${indent}xyzzy\n> EOF\n> git log -1 --pretty=raw --show-notes >output &&\n> test_cmp expect output\n>\n> ok 21 - git log --show-notes\n>\n> expecting success:\n> git log -1 --no-notes >output &&\n> ! grep xyzzy output\n>\n> ok 22 - git log --no-notes\n>\n> expecting success:\n> git format-patch -1 --stdout >output &&\n> ! grep xyzzy output\n>\n> ok 23 - git format-patch does not show notes\n>\n> expecting success:\n> git format-patch --show-notes -1 --stdout >output &&\n> grep xyzzy output\n>\n>     xyzzy\n> ok 24 - git format-patch --show-notes does show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n>     xyzzy\n> ok 25 - git show  does show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 26 - git show --pretty does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 27 - git show --pretty=raw does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 28 - git show --pretty=short does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 29 - git show --pretty=medium does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 30 - git show --pretty=full does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 31 - git show --pretty=fuller does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 32 - git show --pretty=format:%s does not show notes\n>\n> expecting success:\n> git show $p >output &&\n> eval \"$negate grep xyzzy output\"\n>\n> ok 33 - git show --oneline does not show notes\n>\n> expecting success:\n> git notes --ref=alternate add -m alternate\n>\n> ok 34 - setup alternate notes ref\n>\n> expecting success:\n> git log -1 --notes >output &&\n> grep xyzzy output &&\n> ! grep alternate output\n>\n>     xyzzy\n> ok 35 - git log --notes shows default notes\n>\n> expecting success:\n> git log -1 --notes=alternate >output &&\n> ! grep xyzzy output &&\n> grep alternate output\n>\n> Notes (alternate):\n>     alternate\n> ok 36 - git log --notes=X shows only X\n>\n> expecting success:\n> git log -1 --notes --notes=alternate >output &&\n> grep xyzzy output &&\n> grep alternate output\n>\n>     xyzzy\n> Notes (alternate):\n>     alternate\n> ok 37 - git log --notes --notes=X shows both\n>\n> expecting success:\n> git log -1 --notes --notes=alternate \\\n> --no-notes --notes=alternate \\\n>>output &&\n> ! grep xyzzy output &&\n> grep alternate output\n>\n> Notes (alternate):\n>     alternate\n> ok 38 - git log --no-notes resets default state\n>\n> expecting success:\n> git log -1 --notes --notes=alternate \\\n> --no-notes --notes \\\n>>output &&\n> grep xyzzy output &&\n> ! grep alternate output\n>\n>     xyzzy\n> ok 39 - git log --no-notes resets ref list\n>\n> expecting success:\n> test_commit 5th &&\n> git notes add -m spam -m \"foo${LF}bar${LF}baz\" &&\n> cat >expect-m <<-EOF &&\n> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:17:13 2005 -0700\n>\n> ${indent}5th\n>\n> Notes:\n> ${indent}spam\n> ${indent}\n> ${indent}foo\n> ${indent}bar\n> ${indent}baz\n>\n> EOF\n> cat expect-F >>expect-m &&\n> git log -4 >output &&\n> test_cmp expect-m output\n>\n> [master 7f9ad88] 5th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 5th.t\n> ok 40 - show -m notes\n>\n> expecting success:\n> git notes add -f -F /dev/null &&\n> cat >expect-rm-F <<-EOF &&\n> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:17:13 2005 -0700\n>\n> ${indent}5th\n>\n> EOF\n> cat expect-F >>expect-rm-F &&\n> git log -4 >output &&\n> test_cmp expect-rm-F output &&\n> test_must_fail git notes show\n>\n> Overwriting existing notes for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n> ok 41 - remove note with add -f -F /dev/null\n>\n> expecting success:\n> git notes add -m \"\" &&\n> git log -4 >output &&\n> test_cmp expect-rm-F output &&\n> test_must_fail git notes show\n>\n> Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n> ok 42 - do not create empty note with -m \"\"\n>\n> expecting success:\n> cat >expect-combine_m_and_F <<-EOF &&\n> foo\n>\n> xyzzy\n>\n> bar\n>\n> zyxxy\n>\n> baz\n> EOF\n> echo \"xyzzy\" >note_a &&\n> echo \"zyxxy\" >note_b &&\n> git notes add -m \"foo\" -F note_a -m \"bar\" -F note_b -m \"baz\" &&\n> git notes show >output &&\n> test_cmp expect-combine_m_and_F output\n>\n> ok 43 - create note with combination of -m and -F\n>\n> expecting success:\n> git notes remove HEAD^ &&\n> git notes remove &&\n> cat >expect-rm-remove <<-EOF &&\n> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:17:13 2005 -0700\n>\n> ${indent}5th\n>\n> commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:16:13 2005 -0700\n>\n> ${indent}4th\n>\n> EOF\n> cat expect-multiline >>expect-rm-remove &&\n> git log -4 >output &&\n> test_cmp expect-rm-remove output &&\n> test_must_fail git notes show HEAD^\n>\n> Removing note for object HEAD^\n> Removing note for object HEAD\n> error: No note found for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11.\n> ok 44 - remove note with \"git notes remove\"\n>\n> expecting success:\n> git rev-parse --verify refs/notes/commits >before_commit &&\n> test_must_fail git notes remove HEAD^ &&\n> git rev-parse --verify refs/notes/commits >after_commit &&\n> test_cmp before_commit after_commit\n>\n> Object HEAD^ has no note\n> ok 45 - removing non-existing note should not create new commit\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>\n> # We have only two -- add another and make sure it stays\n> git notes add -m \"extra\" &&\n> git notes list HEAD >after-removal-expect &&\n> git notes remove HEAD^^ HEAD^^^ &&\n> git notes list | sed -e \"s/ .*//\" >actual &&\n> test_cmp after-removal-expect actual\n>\n> Removing note for object HEAD^^\n> Removing note for object HEAD^^^\n> ok 46 - removing more than one\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n> test_must_fail git notes remove HEAD^^ HEAD^^^ HEAD^ &&\n> after=$(git rev-parse --verify refs/notes/commits) &&\n> test \"$before\" = \"$after\"\n>\n> Removing note for object HEAD^^\n> Removing note for object HEAD^^^\n> Object HEAD^ has no note\n> ok 47 - removing is atomic\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>\n> # We have only two -- add another and make sure it stays\n> git notes add -m \"extra\" &&\n> git notes list HEAD >after-removal-expect &&\n> git notes remove --ignore-missing HEAD^^ HEAD^^^ HEAD^ &&\n> git notes list | sed -e \"s/ .*//\" >actual &&\n> test_cmp after-removal-expect actual\n>\n> Removing note for object HEAD^^\n> Removing note for object HEAD^^^\n> Object HEAD^ has no note\n> ok 48 - removing with --ignore-missing\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n> test_must_fail git notes remove --ignore-missing HEAD^^ HEAD^^^\n> NO-SUCH-COMMIT &&\n> after=$(git rev-parse --verify refs/notes/commits) &&\n> test \"$before\" = \"$after\"\n>\n> Removing note for object HEAD^^\n> Removing note for object HEAD^^^\n> error: Failed to resolve 'NO-SUCH-COMMIT' as a valid ref.\n> ok 49 - removing with --ignore-missing but bogus ref\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>\n> # We have only two -- add another and make sure it stays\n> git notes add -m \"extra\" &&\n> git notes list HEAD >after-removal-expect &&\n> git rev-parse HEAD^^ HEAD^^^ >input &&\n> git notes remove --stdin <input &&\n> git notes list | sed -e \"s/ .*//\" >actual &&\n> test_cmp after-removal-expect actual\n>\n> Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\n> Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> ok 50 - remove reads from --stdin\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n> git rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\n> test_must_fail git notes remove --stdin <input &&\n> after=$(git rev-parse --verify refs/notes/commits) &&\n> test \"$before\" = \"$after\"\n>\n> Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\n> Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> Object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note\n> ok 51 - remove --stdin is also atomic\n>\n> expecting success:\n> before=$(git rev-parse --verify refs/notes/commits) &&\n> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>\n> # We have only two -- add another and make sure it stays\n> git notes add -m \"extra\" &&\n> git notes list HEAD >after-removal-expect &&\n> git rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\n> git notes remove --ignore-missing --stdin <input &&\n> git notes list | sed -e \"s/ .*//\" >actual &&\n> test_cmp after-removal-expect actual\n>\n> Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\n> Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> Object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note\n> ok 52 - removing with --stdin --ignore-missing\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061\n> 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> c18dc024e14f08d18d14eea0d747ff692d66d6a3\n> d07d62e5208f22eb5695e7eb47667dc8b9860290\n> EOF\n> git notes list >output &&\n> test_cmp expect output\n>\n> ok 53 - list notes with \"git notes list\"\n>\n> expecting success:\n> git notes >output &&\n> test_cmp expect output\n>\n> ok 54 - list notes with \"git notes\"\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> c18dc024e14f08d18d14eea0d747ff692d66d6a3\n> EOF\n> git notes list HEAD^^ >output &&\n> test_cmp expect output\n>\n> ok 55 - list specific note with \"git notes list <object>\"\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> EOF\n> test_must_fail git notes list HEAD >output &&\n> test_cmp expect output\n>\n> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n> ok 56 - listing non-existing notes fails\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> Initial set of notes\n>\n> More notes appended with git notes append\n> EOF\n> git notes add -m \"Initial set of notes\" &&\n> git notes append -m \"More notes appended with git notes append\" &&\n> git notes show >output &&\n> test_cmp expect output\n>\n> ok 57 - append to existing note with \"git notes append\"\n>\n> expecting success:\n> cat >expect_list <<-EOF &&\n> c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061\n> 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n> 4b6ad22357cc8a1296720574b8d2fbc22fab0671\n> 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> c18dc024e14f08d18d14eea0d747ff692d66d6a3\n> d07d62e5208f22eb5695e7eb47667dc8b9860290\n> EOF\n> git notes list >output &&\n> test_cmp expect_list output\n>\n> ok 58 - \"git notes list\" does not expand to \"git notes list HEAD\"\n>\n> expecting success:\n> git notes append -m \"\" &&\n> git notes show >output &&\n> test_cmp expect output\n>\n> ok 59 - appending empty string does not change existing note\n>\n> expecting success:\n> git notes remove HEAD &&\n> test_must_fail git notes list HEAD &&\n> git notes append -m \"Initial set of notes${LF}${LF}More notes appended\n> with git notes append\" &&\n> git notes show >output &&\n> test_cmp expect output\n>\n> Removing note for object HEAD\n> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n> ok 60 - git notes append == add when there is no existing note\n>\n> expecting success:\n> git notes remove HEAD &&\n> test_must_fail git notes list HEAD &&\n> git notes append -m \"\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n> Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n> ok 61 - appending empty string to non-existing note does not create note\n>\n> expecting success:\n> test_commit 6th &&\n> GIT_NOTES_REF=\"refs/notes/other\" git notes add -m \"other note\" &&\n> cat >expect-not-other <<-EOF &&\n> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:18:13 2005 -0700\n>\n> ${indent}6th\n> EOF\n> cp expect-not-other expect-other &&\n> cat >>expect-other <<-EOF\n>\n> Notes (other):\n> ${indent}other note\n> EOF\n>\n> [master 2c12533] 6th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 6th.t\n> ok 62 - create other note on a different notes ref (setup)\n>\n> expecting success:\n> git log -1 >output &&\n> test_cmp expect-not-other output\n>\n> ok 63 - Do not show note on other ref by default\n>\n> expecting success:\n> GIT_NOTES_REF=\"refs/notes/other\" git log -1 >output &&\n> test_cmp expect-other output\n>\n> ok 64 - Do show note when ref is given in GIT_NOTES_REF\n>\n> expecting success:\n> test_config core.notesRef \"refs/notes/other\" &&\n> git log -1 >output &&\n> test_cmp expect-other output\n>\n> ok 65 - Do show note when ref is given in core.notesRef config\n>\n> expecting success:\n> test_config core.notesRef \"refs/notes/other\" &&\n> GIT_NOTES_REF=\"refs/notes/wrong\" git log -1 >output &&\n> test_cmp expect-not-other output\n>\n> ok 66 - Do not show note when core.notesRef is overridden\n>\n> expecting success:\n> cat >expect-both <<-EOF &&\n> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:18:13 2005 -0700\n>\n> ${indent}6th\n>\n> Notes:\n> ${indent}order test\n>\n> Notes (other):\n> ${indent}other note\n>\n> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:17:13 2005 -0700\n>\n> ${indent}5th\n>\n> Notes:\n> ${indent}replacement for deleted note\n> EOF\n> GIT_NOTES_REF=refs/notes/commits git notes add \\\n> -m\"replacement for deleted note\" HEAD^ &&\n> GIT_NOTES_REF=refs/notes/commits git notes add -m\"order test\" &&\n> test_unconfig core.notesRef &&\n> test_config notes.displayRef \"refs/notes/*\" &&\n> git log -2 >output &&\n> test_cmp expect-both output\n>\n> ok 67 - Show all notes when notes.displayRef=refs/notes/*\n>\n> expecting success:\n> test_config core.notesRef refs/notes/commits &&\n> test_config notes.displayRef refs/notes/other &&\n> git log -2 >output &&\n> test_cmp expect-both output\n>\n> ok 68 - core.notesRef is implicitly in notes.displayRef\n>\n> expecting success:\n> test_unconfig core.notesRef &&\n> test_config notes.displayRef refs/notes/commits &&\n> git config --add notes.displayRef refs/notes/other &&\n> git log -2 >output &&\n> test_cmp expect-both output\n>\n> ok 69 - notes.displayRef can be given more than once\n>\n> expecting success:\n> cat >expect-both-reversed <<-EOF &&\n> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:18:13 2005 -0700\n>\n> ${indent}6th\n>\n> Notes (other):\n> ${indent}other note\n>\n> Notes:\n> ${indent}order test\n> EOF\n> test_config core.notesRef refs/notes/other &&\n> test_config notes.displayRef refs/notes/commits &&\n> git log -1 >output &&\n> test_cmp expect-both-reversed output\n>\n> ok 70 - notes.displayRef respects order\n>\n> expecting success:\n> GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n> git log -2 >output &&\n> test_cmp expect-both output\n>\n> ok 71 - GIT_NOTES_DISPLAY_REF works\n>\n> expecting success:\n> cat >expect-none <<-EOF &&\n> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:18:13 2005 -0700\n>\n> ${indent}6th\n>\n> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:17:13 2005 -0700\n>\n> ${indent}5th\n> EOF\n> test_config notes.displayRef \"refs/notes/*\" &&\n> GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >output &&\n> test_cmp expect-none output\n>\n> ok 72 - GIT_NOTES_DISPLAY_REF overrides config\n>\n> expecting success:\n> GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >output &&\n> test_cmp expect-both output\n>\n> ok 73 - --show-notes=* adds to GIT_NOTES_DISPLAY_REF\n>\n> expecting success:\n> cat >expect-commits <<EOF\n> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:18:13 2005 -0700\n>\n> ${indent}6th\n>\n> Notes:\n> ${indent}order test\n> EOF\n> git log --no-standard-notes --show-notes=commits -1 >output &&\n> test_cmp expect-commits output\n>\n> ok 74 - --no-standard-notes\n>\n> expecting success:\n> test_config notes.displayRef \"refs/notes/*\" &&\n> git log --no-standard-notes --show-notes=commits \\\n> --standard-notes -2 >output &&\n> test_cmp expect-both output\n>\n> ok 75 - --standard-notes\n>\n> expecting success:\n> git log --show-notes=other --show-notes=commits \\\n> --no-standard-notes -1 >output &&\n> test_cmp expect-both-reversed output\n>\n> ok 76 - --show-notes=ref accumulates\n>\n> expecting success:\n> test_config core.notesRef refs/notes/other &&\n> echo \"Note on a tree\" >expect &&\n> git notes add -m \"Note on a tree\" HEAD: &&\n> git notes show HEAD: >actual &&\n> test_cmp expect actual &&\n> echo \"Note on a blob\" >expect &&\n> filename=$(git ls-tree --name-only HEAD | head -n1) &&\n> git notes add -m \"Note on a blob\" HEAD:$filename &&\n> git notes show HEAD:$filename >actual &&\n> test_cmp expect actual &&\n> echo \"Note on a tag\" >expect &&\n> git tag -a -m \"This is an annotated tag\" foobar HEAD^ &&\n> git notes add -m \"Note on a tag\" foobar &&\n> git notes show foobar >actual &&\n> test_cmp expect actual\n>\n> ok 77 - Allow notes on non-commits (trees, blobs, tags)\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit fb01e0ca8c33b6cc0c6451dde747f97df567cb5c\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:19:13 2005 -0700\n>\n> ${indent}7th\n>\n> Notes:\n> ${indent}order test\n> EOF\n> test_commit 7th &&\n> git notes add -C $(git notes list HEAD^) &&\n> git log -1 >actual &&\n> test_cmp expect actual &&\n> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n>\n> [master fb01e0c] 7th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 7th.t\n> ok 78 - create note from other note with \"git notes add -C\"\n>\n> expecting success:\n> test_commit 8th &&\n> test_must_fail git notes add -C deadbeef &&\n> test_must_fail git notes list HEAD\n>\n> [master 9a4c31c] 8th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 8th.t\n> fatal: Failed to resolve 'deadbeef' as a valid ref.\n> error: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.\n> ok 79 - create note from non-existing note with \"git notes add -C\" fails\n>\n> expecting success:\n> commit=$(git rev-parse --verify HEAD) &&\n> tree=$(git rev-parse --verify HEAD:) &&\n> test_must_fail git notes add -C $commit &&\n> test_must_fail git notes add -C $tree &&\n> test_must_fail git notes list HEAD\n>\n> fatal: Cannot read note data from non-blob object\n> '9a4c31c7f722b5d517e92c64e932dd751e1413bf'.\n> fatal: Cannot read note data from non-blob object\n> '37f6454412e4ed89ae47782f956ed0fb573892f6'.\n> error: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.\n> ok 80 - create note from non-blob with \"git notes add -C\" fails\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 9a4c31c7f722b5d517e92c64e932dd751e1413bf\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:20:13 2005 -0700\n>\n> ${indent}8th\n>\n> Notes:\n> ${indent}This is a blob object\n> EOF\n> blob=$(echo \"This is a blob object\" | git hash-object -w --stdin) &&\n> git notes add -C $blob &&\n> git log -1 >actual &&\n> test_cmp expect actual &&\n> test \"$(git notes list HEAD)\" = \"$blob\"\n>\n> ok 81 - create note from blob with \"git notes add -C\" reuses blob id\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:21:13 2005 -0700\n>\n> ${indent}9th\n>\n> Notes:\n> ${indent}yet another note\n> EOF\n> test_commit 9th &&\n> MSG=\"yet another note\" git notes add -c $(git notes list HEAD^^) &&\n> git log -1 >actual &&\n> test_cmp expect actual\n>\n> [master 2e0db4b] 9th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 9th.t\n> yet another note\n> ok 82 - create note from other note with \"git notes add -c\"\n>\n> expecting success:\n> test_commit 10th &&\n> test_must_fail env MSG=\"yet another note\" git notes add -c deadbeef &&\n> test_must_fail git notes list HEAD\n>\n> [master 7c3b87a] 10th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 10th.t\n> fatal: Failed to resolve 'deadbeef' as a valid ref.\n> error: No note found for object 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406.\n> ok 83 - create note from non-existing note with \"git notes add -c\" fails\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:21:13 2005 -0700\n>\n> ${indent}9th\n>\n> Notes:\n> ${indent}yet another note\n> ${indent}\n> ${indent}yet another note\n> EOF\n> git notes append -C $(git notes list HEAD^) HEAD^ &&\n> git log -1 HEAD^ >actual &&\n> test_cmp expect actual\n>\n> ok 84 - append to note from other note with \"git notes append -C\"\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:22:13 2005 -0700\n>\n> ${indent}10th\n>\n> Notes:\n> ${indent}other note\n> EOF\n> MSG=\"other note\" git notes append -c $(git notes list HEAD^) &&\n> git log -1 >actual &&\n> test_cmp expect actual\n>\n> other note\n> ok 85 - create note from other note with \"git notes append -c\"\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:22:13 2005 -0700\n>\n> ${indent}10th\n>\n> Notes:\n> ${indent}other note\n> ${indent}\n> ${indent}yet another note\n> EOF\n> MSG=\"yet another note\" git notes append -c $(git notes list HEAD) &&\n> git log -1 >actual &&\n> test_cmp expect actual\n>\n> yet another note\n> ok 86 - append to note from other note with \"git notes append -c\"\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:23:13 2005 -0700\n>\n> ${indent}11th\n>\n> Notes:\n> ${indent}other note\n> ${indent}\n> ${indent}yet another note\n> EOF\n> test_commit 11th &&\n> git notes copy HEAD^ HEAD &&\n> git log -1 >actual &&\n> test_cmp expect actual &&\n> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n>\n> [master a446fff] 11th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 11th.t\n> ok 87 - copy note with \"git notes copy\"\n>\n> expecting success:\n> test_must_fail git notes copy HEAD~2 HEAD &&\n> git log -1 >actual &&\n> test_cmp expect actual &&\n> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n>\n> error: Cannot copy notes. Found existing notes for object\n> a446fff8777efdc6eb8f4b7c8a5ff699484df0d5. Use '-f' to overwrite\n> existing notes\n> ok 88 - prevent overwrite with \"git notes copy\"\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:23:13 2005 -0700\n>\n> ${indent}11th\n>\n> Notes:\n> ${indent}yet another note\n> ${indent}\n> ${indent}yet another note\n> EOF\n> git notes copy -f HEAD~2 HEAD &&\n> git log -1 >actual &&\n> test_cmp expect actual &&\n> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD~2)\"\n>\n> Overwriting existing notes for object a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n> ok 89 - allow overwrite with \"git notes copy -f\"\n>\n> expecting success:\n> test_commit 12th &&\n> test_commit 13th &&\n> test_must_fail git notes copy HEAD^ HEAD\n>\n> [master 65e263d] 12th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 12th.t\n> [master e871aa6] 13th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 13th.t\n> error: Missing notes on source object\n> 65e263ded02ae4e8839bc151095113737579dc12. Cannot copy.\n> ok 90 - cannot copy note from object without notes\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit e871aa61182b1d95d0a6fb75445d891722863b6b\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:25:13 2005 -0700\n>\n> ${indent}13th\n>\n> Notes:\n> ${indent}yet another note\n> ${indent}\n> ${indent}yet another note\n>\n> commit 65e263ded02ae4e8839bc151095113737579dc12\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:24:13 2005 -0700\n>\n> ${indent}12th\n>\n> Notes:\n> ${indent}other note\n> ${indent}\n> ${indent}yet another note\n> EOF\n> (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n> echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n> git notes copy --stdin &&\n> git log -2 >output &&\n> test_cmp expect output &&\n> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD~2)\" &&\n> test \"$(git notes list HEAD^)\" = \"$(git notes list HEAD~3)\"\n>\n> ok 91 - git notes copy --stdin\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> commit 07c85d77059393ed0154b8c96906547a59dfcddd\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:26:13 2005 -0700\n>\n> ${indent}14th\n> EOF\n> test_commit 14th &&\n> test_commit 15th &&\n> (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n> echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n> git notes copy --for-rewrite=foo &&\n> git log -2 >output &&\n> test_cmp expect output\n>\n> [master 07c85d7] 14th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 14th.t\n> [master 4acf42e] 15th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 15th.t\n> ok 92 - git notes copy --for-rewrite (unconfigured)\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> Notes:\n> ${indent}yet another note\n> ${indent}\n> ${indent}yet another note\n>\n> commit 07c85d77059393ed0154b8c96906547a59dfcddd\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:26:13 2005 -0700\n>\n> ${indent}14th\n>\n> Notes:\n> ${indent}other note\n> ${indent}\n> ${indent}yet another note\n> EOF\n> test_config notes.rewriteMode overwrite &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n> echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n> git notes copy --for-rewrite=foo &&\n> git log -2 >output &&\n> test_cmp expect output\n>\n> ok 93 - git notes copy --for-rewrite (enabled)\n>\n> expecting success:\n> test_config notes.rewrite.bar false &&\n> echo $(git rev-parse HEAD~3) $(git rev-parse HEAD) |\n> git notes copy --for-rewrite=bar &&\n> git log -2 >output &&\n> test_cmp expect output\n>\n> ./test-lib.sh: line 536: echo: write error: Broken pipe\n> ok 94 - git notes copy --for-rewrite (disabled)\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> Notes:\n> ${indent}a fresh note\n> EOF\n> git notes add -f -m\"a fresh note\" HEAD^ &&\n> test_config notes.rewriteMode overwrite &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n> ok 95 - git notes copy --for-rewrite (overwrite)\n>\n> expecting success:\n> test_config notes.rewriteMode ignore &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> ok 96 - git notes copy --for-rewrite (ignore)\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> Notes:\n> ${indent}a fresh note\n> ${indent}\n> ${indent}another fresh note\n> EOF\n> git notes add -f -m\"another fresh note\" HEAD^ &&\n> test_config notes.rewriteMode concatenate &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n> ok 97 - git notes copy --for-rewrite (append)\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> Notes:\n> ${indent}a fresh note\n> ${indent}\n> ${indent}another fresh note\n> ${indent}\n> ${indent}append 1\n> ${indent}\n> ${indent}append 2\n> EOF\n> git notes add -f -m\"append 1\" HEAD^ &&\n> git notes add -f -m\"append 2\" HEAD^^ &&\n> test_config notes.rewriteMode concatenate &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> (echo $(git rev-parse HEAD^) $(git rev-parse HEAD);\n> echo $(git rev-parse HEAD^^) $(git rev-parse HEAD)) |\n> git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n> Overwriting existing notes for object e871aa61182b1d95d0a6fb75445d891722863b6b\n> ok 98 - git notes copy --for-rewrite (append two to one)\n>\n> expecting success:\n> git notes remove HEAD^ &&\n> test_config notes.rewriteMode concatenate &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> Removing note for object HEAD^\n> ok 99 - git notes copy --for-rewrite (append empty)\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> Notes:\n> ${indent}replacement note 1\n> EOF\n> test_config notes.rewriteMode concatenate &&\n> test_config notes.rewriteRef \"refs/notes/*\" &&\n> git notes add -f -m\"replacement note 1\" HEAD^ &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> GIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> ok 100 - GIT_NOTES_REWRITE_MODE works\n>\n> expecting success:\n> cat >expect <<-EOF &&\n> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n> Author: A U Thor <author@example.com>\n> Date:   Thu Apr 7 15:27:13 2005 -0700\n>\n> ${indent}15th\n>\n> Notes:\n> ${indent}replacement note 2\n> EOF\n> git notes add -f -m\"replacement note 2\" HEAD^ &&\n> test_config notes.rewriteMode overwrite &&\n> test_unconfig notes.rewriteRef &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> GIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \\\n> git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n> ok 101 - GIT_NOTES_REWRITE_REF works\n>\n> expecting success:\n> git notes add -f -m\"replacement note 3\" HEAD^ &&\n> test_config notes.rewriteMode overwrite &&\n> test_config notes.rewriteRef refs/notes/other &&\n> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n> GIT_NOTES_REWRITE_REF= git notes copy --for-rewrite=foo &&\n> git log -1 >output &&\n> test_cmp expect output\n>\n> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n> ./test-lib.sh: line 538: echo: write error: Broken pipe\n> ok 102 - GIT_NOTES_REWRITE_REF overrides config\n>\n> expecting success:\n> test_must_fail git notes copy &&\n> test_must_fail git notes copy one two three\n>\n> error: too few parameters\n> usage: git notes copy [<options>] <from-object> <to-object>\n>    or: git notes copy --stdin [<from-object> <to-object>]...\n>\n>     -f, --force           replace existing notes\n>     --stdin               read objects from stdin\n>     --for-rewrite <command>\n>                           load rewriting config for <command> (implies --stdin)\n>\n> error: too many parameters\n> usage: git notes copy [<options>] <from-object> <to-object>\n>    or: git notes copy --stdin [<from-object> <to-object>]...\n>\n>     -f, --force           replace existing notes\n>     --stdin               read objects from stdin\n>     --for-rewrite <command>\n>                           load rewriting config for <command> (implies --stdin)\n>\n> ok 103 - git notes copy diagnoses too many or too few parameters\n>\n> expecting success:\n> test_unconfig core.notesRef &&\n> sane_unset GIT_NOTES_REF &&\n> test \"$(git notes get-ref)\" = \"refs/notes/commits\"\n>\n> ok 104 - git notes get-ref (no overrides)\n>\n> expecting success:\n> test_config core.notesRef refs/notes/foo &&\n> test \"$(git notes get-ref)\" = \"refs/notes/foo\"\n>\n> ok 105 - git notes get-ref (core.notesRef)\n>\n> expecting success:\n> test \"$(GIT_NOTES_REF=refs/notes/bar git notes get-ref)\" = \"refs/notes/bar\"\n>\n> ok 106 - git notes get-ref (GIT_NOTES_REF)\n>\n> expecting success:\n> test \"$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)\" =\n> \"refs/notes/baz\"\n>\n> ok 107 - git notes get-ref (--ref)\n>\n> expecting success:\n> test_unconfig core.notesRef &&\n> test_commit 16th &&\n> empty_blob=$(git hash-object -w /dev/null) &&\n> echo \"$empty_blob\" >expect_empty\n>\n> [master 21d0abc] 16th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 16th.t\n> ok 108 - setup testing of empty notes\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add &&\n> test_must_fail git notes list HEAD\n>\n> Object HEAD has no note\n>\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 109 - 'git notes add' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n>\n> ok 110 - 'git notes add --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -F /dev/null &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 111 - 'git notes add -F /dev/null' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -F /dev/null --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n> ok 112 - 'git notes add -F /dev/null --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -m \"\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 113 - 'git notes add -m \"\"' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -m \"\" --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n> ok 114 - 'git notes add -m \"\" --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -c \"$empty_blob\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n>\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 115 - 'git notes add -c \"$empty_blob\"' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -c \"$empty_blob\" --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n>\n> ok 116 - 'git notes add -c \"$empty_blob\" --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -C \"$empty_blob\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 117 - 'git notes add -C \"$empty_blob\"' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes add -C \"$empty_blob\" --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n> ok 118 - 'git notes add -C \"$empty_blob\" --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n>\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 119 - 'git notes append' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n>\n> ok 120 - 'git notes append --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -F /dev/null &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 121 - 'git notes append -F /dev/null' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -F /dev/null --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n> ok 122 - 'git notes append -F /dev/null --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -m \"\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 123 - 'git notes append -m \"\"' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -m \"\" --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n> ok 124 - 'git notes append -m \"\" --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -c \"$empty_blob\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n>\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 125 - 'git notes append -c \"$empty_blob\"' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -c \"$empty_blob\" --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n>\n> ok 126 - 'git notes append -c \"$empty_blob\" --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -C \"$empty_blob\" &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 127 - 'git notes append -C \"$empty_blob\"' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes append -C \"$empty_blob\" --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n> ok 128 - 'git notes append -C \"$empty_blob\" --allow-empty' stores empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes edit &&\n> test_must_fail git notes list HEAD\n>\n> Removing note for object HEAD\n>\n> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n> ok 129 - 'git notes edit' removes empty note\n>\n> expecting success:\n> test_might_fail git notes remove HEAD &&\n> MSG= git notes edit --allow-empty &&\n> git notes list HEAD >actual &&\n> test_cmp expect_empty actual\n>\n> Object HEAD has no note\n>\n> ok 130 - 'git notes edit --allow-empty' stores empty note\n>\n> expecting success:\n> test_commit 17th &&\n> git log -1 >expect &&\n> cat >>expect <<-EOF &&\n>\n> Notes:\n> EOF\n> git notes add -C \"$empty_blob\" --allow-empty &&\n> git log -1 >actual &&\n> test_cmp expect actual\n>\n> [master 27a79f3] 17th\n>  Author: A U Thor <author@example.com>\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 17th.t\n> ok 131 - empty notes are displayed by git log\n>\n> # failed 6 among 131 test(s)\n> 1..131\n"},{"id":"251699","messageId":"CAO2U3QidAQfXBOEuYsXnZ13DtVtW42mN+9k+8Miw9vy1gN1s0Q@mail.gmail.com","threadId":"37929","inReplyTo":"CAO2U3QgS+wDSSn0X1ThHtjLbuJJ7NTBMyJG6rUvHe+UFbibNdw@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Michael Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-11T00:46:45Z","receivedAt":"2014-11-11T00:46:45Z","isPatch":false,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"my first thought was that this might be a bash versioning issue, since\nthe commit in question basically refactors the script, and macs ship\nwith an archaic version of bash, but I have the same problem with bash\n4.3.30\n\nOn Mon, Nov 10, 2014 at 4:23 PM, Michael Blume <blume.mike@gmail.com> wrote:\n> (to be clear: I ran git bisect, and traced the problem to the modernize commit)\n>\n> On Mon, Nov 10, 2014 at 4:17 PM, Michael Blume <blume.mike@gmail.com> wrote:\n>> the commit modernizing test 3301\n>> (https://github.com/git/git/commit/fbe4f74865acfd) appears to break it\n>> on my mac\n>>\n>> Verbose output follows:\n>>\n>> $ ./t3301-notes.sh -v\n>> Initialized empty Git repository in\n>> /Users/michael.blume/workspace/git/t/trash directory.t3301-notes/.git/\n>> expecting success:\n>> test_must_fail env MSG=3 git notes add\n>>\n>> fatal: Failed to resolve 'HEAD' as a valid ref.\n>> ok 1 - cannot annotate non-existing HEAD\n>>\n>> expecting success:\n>> test_commit 1st &&\n>> test_commit 2nd\n>>\n>> [master (root-commit) 04ed9a0] 1st\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 1st.t\n>> [master 7a4ca6e] 2nd\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 2nd.t\n>> ok 2 - setup\n>>\n>> expecting success:\n>> test_must_fail env MSG=1 GIT_NOTES_REF=/ git notes show &&\n>> test_must_fail env MSG=2 GIT_NOTES_REF=/ git notes show\n>>\n>> fatal: Refusing to show notes in / (outside of refs/notes/)\n>> fatal: Refusing to show notes in / (outside of refs/notes/)\n>> ok 3 - need valid notes ref\n>>\n>> expecting success:\n>> test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes add\n>>\n>> fatal: Refusing to add notes in refs/heads/bogus (outside of refs/notes/)\n>> ok 4 - refusing to add notes in refs/heads/\n>>\n>> expecting success:\n>> test_must_fail env MSG=1 GIT_NOTES_REF=refs/heads/bogus git notes edit\n>>\n>> fatal: Refusing to edit notes in refs/heads/bogus (outside of refs/notes/)\n>> ok 5 - refusing to edit notes in refs/remotes/\n>>\n>> expecting success:\n>> test_expect_code 1 git notes show\n>>\n>> error: No note found for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691.\n>> ok 6 - handle empty notes gracefully\n>>\n>> expecting success:\n>> test_write_lines A B >expect &&\n>> git show -s --format=\"A%n%NB\" >output &&\n>> test_cmp expect output\n>>\n>> ok 7 - show non-existent notes entry with %N\n>>\n>> expecting success:\n>> MSG=b4 git notes add &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b4\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> b4\n>> not ok 8 - create notes\n>> #\n>> # MSG=b4 git notes add &&\n>> # test_path_is_missing .git/NOTES_EDITMSG &&\n>> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> # test \"b4\" = \"$(git notes show)\" &&\n>> # git show HEAD^ &&\n>> # test_must_fail git notes show HEAD^\n>> #\n>>\n>> expecting success:\n>> test_write_lines A b4 B >expect &&\n>> git show -s --format=\"A%n%NB\" >output &&\n>> test_cmp expect output\n>>\n>> ok 9 - show notes entry with %N\n>>\n>> expecting success:\n>> cat <<-EOF >expect &&\n>> a1d8fa6 refs/notes/commits@{0}: notes: Notes added by 'git notes add'\n>> EOF\n>> git reflog show refs/notes/commits >output &&\n>> test_cmp expect output\n>>\n>> ok 10 - create reflog entry\n>>\n>> expecting success:\n>> MSG=b3 git notes edit &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b3\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> b3\n>> not ok 11 - edit existing notes\n>> #\n>> # MSG=b3 git notes edit &&\n>> # test_path_is_missing .git/NOTES_EDITMSG &&\n>> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> # test \"b3\" = \"$(git notes show)\" &&\n>> # git show HEAD^ &&\n>> # test_must_fail git notes show HEAD^\n>> #\n>>\n>> expecting success:\n>> test_must_fail git notes add -m \"b2\" &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b3\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> error: Cannot add notes. Found existing notes for object\n>> 7a4ca6ee52a974a66cbaa78e33214535dff1d691. Use '-f' to overwrite\n>> existing notes\n>> not ok 12 - cannot \"git notes add -m\" where notes already exists\n>> #\n>> # test_must_fail git notes add -m \"b2\" &&\n>> # test_path_is_missing .git/NOTES_EDITMSG &&\n>> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> # test \"b3\" = \"$(git notes show)\" &&\n>> # git show HEAD^ &&\n>> # test_must_fail git notes show HEAD^\n>> #\n>>\n>> expecting success:\n>> git notes add -f -m \"b1\" &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b1\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> not ok 13 - can overwrite existing note with \"git notes add -f -m\"\n>> #\n>> # git notes add -f -m \"b1\" &&\n>> # test_path_is_missing .git/NOTES_EDITMSG &&\n>> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> # test \"b1\" = \"$(git notes show)\" &&\n>> # git show HEAD^ &&\n>> # test_must_fail git notes show HEAD^\n>> #\n>>\n>> expecting success:\n>> MSG=b2 git notes add &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b2\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> b2\n>> not ok 14 - add w/no options on existing note morphs into edit\n>> #\n>> # MSG=b2 git notes add &&\n>> # test_path_is_missing .git/NOTES_EDITMSG &&\n>> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> # test \"b2\" = \"$(git notes show)\" &&\n>> # git show HEAD^ &&\n>> # test_must_fail git notes show HEAD^\n>> #\n>>\n>> expecting success:\n>> MSG=b1 git notes add -f &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b1\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> Overwriting existing notes for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> b1\n>> not ok 15 - can overwrite existing note with \"git notes add -f\"\n>> #\n>> # MSG=b1 git notes add -f &&\n>> # test_path_is_missing .git/NOTES_EDITMSG &&\n>> # test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> # test \"b1\" = \"$(git notes show)\" &&\n>> # git show HEAD^ &&\n>> # test_must_fail git notes show HEAD^\n>> #\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:14:13 2005 -0700\n>>\n>> ${indent}2nd\n>>\n>> Notes:\n>> ${indent}b1\n>> EOF\n>> ! (git cat-file commit HEAD | grep b1) &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> ok 16 - show notes\n>>\n>> expecting success:\n>> test_commit 3rd &&\n>> MSG=\"b3${LF}c3c3c3c3${LF}d3d3d3\" git notes add &&\n>> cat >expect-multiline <<-EOF &&\n>> commit d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:15:13 2005 -0700\n>>\n>> ${indent}3rd\n>>\n>> Notes:\n>> ${indent}b3\n>> ${indent}c3c3c3c3\n>> ${indent}d3d3d3\n>>\n>> EOF\n>> cat expect >>expect-multiline &&\n>> git log -2 >output &&\n>> test_cmp expect-multiline output\n>>\n>> [master d07d62e] 3rd\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 3rd.t\n>> b3\n>> c3c3c3c3\n>> d3d3d3\n>> ok 17 - show multi-line notes\n>>\n>> expecting success:\n>> test_commit 4th &&\n>> echo \"xyzzy\" >note5 &&\n>> git notes add -F note5 &&\n>> cat >expect-F <<-EOF &&\n>> commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:16:13 2005 -0700\n>>\n>> ${indent}4th\n>>\n>> Notes:\n>> ${indent}xyzzy\n>>\n>> EOF\n>> cat expect-multiline >>expect-F &&\n>> git log -3 >output &&\n>> test_cmp expect-F output\n>>\n>> [master 0f7aa3e] 4th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 4th.t\n>> ok 18 - show -F notes\n>>\n>> expecting success:\n>> echo \"zyxxy\" >note5 &&\n>> test_must_fail git notes add -F note5 &&\n>> git log -3 >output &&\n>> test_cmp expect-F output\n>>\n>> error: Cannot add notes. Found existing notes for object\n>> 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11. Use '-f' to overwrite\n>> existing notes\n>> ok 19 - Re-adding -F notes without -f fails\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n>> tree 05ac65288c4c4b3b709a020ae94b2ece2f2201ae\n>> parent d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> author A U Thor <author@example.com> 1112912173 -0700\n>> committer C O Mitter <committer@example.com> 1112912173 -0700\n>>\n>> ${indent}4th\n>> EOF\n>> git log -1 --pretty=raw >output &&\n>> test_cmp expect output\n>>\n>> ok 20 - git log --pretty=raw does not show notes\n>>\n>> expecting success:\n>> cat >>expect <<-EOF &&\n>>\n>> Notes:\n>> ${indent}xyzzy\n>> EOF\n>> git log -1 --pretty=raw --show-notes >output &&\n>> test_cmp expect output\n>>\n>> ok 21 - git log --show-notes\n>>\n>> expecting success:\n>> git log -1 --no-notes >output &&\n>> ! grep xyzzy output\n>>\n>> ok 22 - git log --no-notes\n>>\n>> expecting success:\n>> git format-patch -1 --stdout >output &&\n>> ! grep xyzzy output\n>>\n>> ok 23 - git format-patch does not show notes\n>>\n>> expecting success:\n>> git format-patch --show-notes -1 --stdout >output &&\n>> grep xyzzy output\n>>\n>>     xyzzy\n>> ok 24 - git format-patch --show-notes does show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>>     xyzzy\n>> ok 25 - git show  does show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 26 - git show --pretty does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 27 - git show --pretty=raw does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 28 - git show --pretty=short does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 29 - git show --pretty=medium does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 30 - git show --pretty=full does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 31 - git show --pretty=fuller does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 32 - git show --pretty=format:%s does not show notes\n>>\n>> expecting success:\n>> git show $p >output &&\n>> eval \"$negate grep xyzzy output\"\n>>\n>> ok 33 - git show --oneline does not show notes\n>>\n>> expecting success:\n>> git notes --ref=alternate add -m alternate\n>>\n>> ok 34 - setup alternate notes ref\n>>\n>> expecting success:\n>> git log -1 --notes >output &&\n>> grep xyzzy output &&\n>> ! grep alternate output\n>>\n>>     xyzzy\n>> ok 35 - git log --notes shows default notes\n>>\n>> expecting success:\n>> git log -1 --notes=alternate >output &&\n>> ! grep xyzzy output &&\n>> grep alternate output\n>>\n>> Notes (alternate):\n>>     alternate\n>> ok 36 - git log --notes=X shows only X\n>>\n>> expecting success:\n>> git log -1 --notes --notes=alternate >output &&\n>> grep xyzzy output &&\n>> grep alternate output\n>>\n>>     xyzzy\n>> Notes (alternate):\n>>     alternate\n>> ok 37 - git log --notes --notes=X shows both\n>>\n>> expecting success:\n>> git log -1 --notes --notes=alternate \\\n>> --no-notes --notes=alternate \\\n>>>output &&\n>> ! grep xyzzy output &&\n>> grep alternate output\n>>\n>> Notes (alternate):\n>>     alternate\n>> ok 38 - git log --no-notes resets default state\n>>\n>> expecting success:\n>> git log -1 --notes --notes=alternate \\\n>> --no-notes --notes \\\n>>>output &&\n>> grep xyzzy output &&\n>> ! grep alternate output\n>>\n>>     xyzzy\n>> ok 39 - git log --no-notes resets ref list\n>>\n>> expecting success:\n>> test_commit 5th &&\n>> git notes add -m spam -m \"foo${LF}bar${LF}baz\" &&\n>> cat >expect-m <<-EOF &&\n>> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:17:13 2005 -0700\n>>\n>> ${indent}5th\n>>\n>> Notes:\n>> ${indent}spam\n>> ${indent}\n>> ${indent}foo\n>> ${indent}bar\n>> ${indent}baz\n>>\n>> EOF\n>> cat expect-F >>expect-m &&\n>> git log -4 >output &&\n>> test_cmp expect-m output\n>>\n>> [master 7f9ad88] 5th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 5th.t\n>> ok 40 - show -m notes\n>>\n>> expecting success:\n>> git notes add -f -F /dev/null &&\n>> cat >expect-rm-F <<-EOF &&\n>> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:17:13 2005 -0700\n>>\n>> ${indent}5th\n>>\n>> EOF\n>> cat expect-F >>expect-rm-F &&\n>> git log -4 >output &&\n>> test_cmp expect-rm-F output &&\n>> test_must_fail git notes show\n>>\n>> Overwriting existing notes for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n>> ok 41 - remove note with add -f -F /dev/null\n>>\n>> expecting success:\n>> git notes add -m \"\" &&\n>> git log -4 >output &&\n>> test_cmp expect-rm-F output &&\n>> test_must_fail git notes show\n>>\n>> Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n>> ok 42 - do not create empty note with -m \"\"\n>>\n>> expecting success:\n>> cat >expect-combine_m_and_F <<-EOF &&\n>> foo\n>>\n>> xyzzy\n>>\n>> bar\n>>\n>> zyxxy\n>>\n>> baz\n>> EOF\n>> echo \"xyzzy\" >note_a &&\n>> echo \"zyxxy\" >note_b &&\n>> git notes add -m \"foo\" -F note_a -m \"bar\" -F note_b -m \"baz\" &&\n>> git notes show >output &&\n>> test_cmp expect-combine_m_and_F output\n>>\n>> ok 43 - create note with combination of -m and -F\n>>\n>> expecting success:\n>> git notes remove HEAD^ &&\n>> git notes remove &&\n>> cat >expect-rm-remove <<-EOF &&\n>> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:17:13 2005 -0700\n>>\n>> ${indent}5th\n>>\n>> commit 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:16:13 2005 -0700\n>>\n>> ${indent}4th\n>>\n>> EOF\n>> cat expect-multiline >>expect-rm-remove &&\n>> git log -4 >output &&\n>> test_cmp expect-rm-remove output &&\n>> test_must_fail git notes show HEAD^\n>>\n>> Removing note for object HEAD^\n>> Removing note for object HEAD\n>> error: No note found for object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11.\n>> ok 44 - remove note with \"git notes remove\"\n>>\n>> expecting success:\n>> git rev-parse --verify refs/notes/commits >before_commit &&\n>> test_must_fail git notes remove HEAD^ &&\n>> git rev-parse --verify refs/notes/commits >after_commit &&\n>> test_cmp before_commit after_commit\n>>\n>> Object HEAD^ has no note\n>> ok 45 - removing non-existing note should not create new commit\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>>\n>> # We have only two -- add another and make sure it stays\n>> git notes add -m \"extra\" &&\n>> git notes list HEAD >after-removal-expect &&\n>> git notes remove HEAD^^ HEAD^^^ &&\n>> git notes list | sed -e \"s/ .*//\" >actual &&\n>> test_cmp after-removal-expect actual\n>>\n>> Removing note for object HEAD^^\n>> Removing note for object HEAD^^^\n>> ok 46 - removing more than one\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>> test_must_fail git notes remove HEAD^^ HEAD^^^ HEAD^ &&\n>> after=$(git rev-parse --verify refs/notes/commits) &&\n>> test \"$before\" = \"$after\"\n>>\n>> Removing note for object HEAD^^\n>> Removing note for object HEAD^^^\n>> Object HEAD^ has no note\n>> ok 47 - removing is atomic\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>>\n>> # We have only two -- add another and make sure it stays\n>> git notes add -m \"extra\" &&\n>> git notes list HEAD >after-removal-expect &&\n>> git notes remove --ignore-missing HEAD^^ HEAD^^^ HEAD^ &&\n>> git notes list | sed -e \"s/ .*//\" >actual &&\n>> test_cmp after-removal-expect actual\n>>\n>> Removing note for object HEAD^^\n>> Removing note for object HEAD^^^\n>> Object HEAD^ has no note\n>> ok 48 - removing with --ignore-missing\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>> test_must_fail git notes remove --ignore-missing HEAD^^ HEAD^^^\n>> NO-SUCH-COMMIT &&\n>> after=$(git rev-parse --verify refs/notes/commits) &&\n>> test \"$before\" = \"$after\"\n>>\n>> Removing note for object HEAD^^\n>> Removing note for object HEAD^^^\n>> error: Failed to resolve 'NO-SUCH-COMMIT' as a valid ref.\n>> ok 49 - removing with --ignore-missing but bogus ref\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>>\n>> # We have only two -- add another and make sure it stays\n>> git notes add -m \"extra\" &&\n>> git notes list HEAD >after-removal-expect &&\n>> git rev-parse HEAD^^ HEAD^^^ >input &&\n>> git notes remove --stdin <input &&\n>> git notes list | sed -e \"s/ .*//\" >actual &&\n>> test_cmp after-removal-expect actual\n>>\n>> Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> ok 50 - remove reads from --stdin\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>> git rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\n>> test_must_fail git notes remove --stdin <input &&\n>> after=$(git rev-parse --verify refs/notes/commits) &&\n>> test \"$before\" = \"$after\"\n>>\n>> Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> Object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note\n>> ok 51 - remove --stdin is also atomic\n>>\n>> expecting success:\n>> before=$(git rev-parse --verify refs/notes/commits) &&\n>> test_when_finished \"git update-ref refs/notes/commits $before\" &&\n>>\n>> # We have only two -- add another and make sure it stays\n>> git notes add -m \"extra\" &&\n>> git notes list HEAD >after-removal-expect &&\n>> git rev-parse HEAD^^ HEAD^^^ HEAD^ >input &&\n>> git notes remove --ignore-missing --stdin <input &&\n>> git notes list | sed -e \"s/ .*//\" >actual &&\n>> test_cmp after-removal-expect actual\n>>\n>> Removing note for object d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> Removing note for object 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> Object 0f7aa3ec6325aeb88b910453bb3eb37c49d75c11 has no note\n>> ok 52 - removing with --stdin --ignore-missing\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061\n>> 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> c18dc024e14f08d18d14eea0d747ff692d66d6a3\n>> d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> EOF\n>> git notes list >output &&\n>> test_cmp expect output\n>>\n>> ok 53 - list notes with \"git notes list\"\n>>\n>> expecting success:\n>> git notes >output &&\n>> test_cmp expect output\n>>\n>> ok 54 - list notes with \"git notes\"\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> c18dc024e14f08d18d14eea0d747ff692d66d6a3\n>> EOF\n>> git notes list HEAD^^ >output &&\n>> test_cmp expect output\n>>\n>> ok 55 - list specific note with \"git notes list <object>\"\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> EOF\n>> test_must_fail git notes list HEAD >output &&\n>> test_cmp expect output\n>>\n>> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n>> ok 56 - listing non-existing notes fails\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> Initial set of notes\n>>\n>> More notes appended with git notes append\n>> EOF\n>> git notes add -m \"Initial set of notes\" &&\n>> git notes append -m \"More notes appended with git notes append\" &&\n>> git notes show >output &&\n>> test_cmp expect output\n>>\n>> ok 57 - append to existing note with \"git notes append\"\n>>\n>> expecting success:\n>> cat >expect_list <<-EOF &&\n>> c9c6af7f78bc47490dbf3e822cf2f3c24d4b9061\n>> 7a4ca6ee52a974a66cbaa78e33214535dff1d691\n>> 4b6ad22357cc8a1296720574b8d2fbc22fab0671\n>> 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> c18dc024e14f08d18d14eea0d747ff692d66d6a3\n>> d07d62e5208f22eb5695e7eb47667dc8b9860290\n>> EOF\n>> git notes list >output &&\n>> test_cmp expect_list output\n>>\n>> ok 58 - \"git notes list\" does not expand to \"git notes list HEAD\"\n>>\n>> expecting success:\n>> git notes append -m \"\" &&\n>> git notes show >output &&\n>> test_cmp expect output\n>>\n>> ok 59 - appending empty string does not change existing note\n>>\n>> expecting success:\n>> git notes remove HEAD &&\n>> test_must_fail git notes list HEAD &&\n>> git notes append -m \"Initial set of notes${LF}${LF}More notes appended\n>> with git notes append\" &&\n>> git notes show >output &&\n>> test_cmp expect output\n>>\n>> Removing note for object HEAD\n>> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n>> ok 60 - git notes append == add when there is no existing note\n>>\n>> expecting success:\n>> git notes remove HEAD &&\n>> test_must_fail git notes list HEAD &&\n>> git notes append -m \"\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n>> Removing note for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> error: No note found for object 7f9ad8836c775acb134c0a055fc55fb4cd1ba361.\n>> ok 61 - appending empty string to non-existing note does not create note\n>>\n>> expecting success:\n>> test_commit 6th &&\n>> GIT_NOTES_REF=\"refs/notes/other\" git notes add -m \"other note\" &&\n>> cat >expect-not-other <<-EOF &&\n>> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:18:13 2005 -0700\n>>\n>> ${indent}6th\n>> EOF\n>> cp expect-not-other expect-other &&\n>> cat >>expect-other <<-EOF\n>>\n>> Notes (other):\n>> ${indent}other note\n>> EOF\n>>\n>> [master 2c12533] 6th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 6th.t\n>> ok 62 - create other note on a different notes ref (setup)\n>>\n>> expecting success:\n>> git log -1 >output &&\n>> test_cmp expect-not-other output\n>>\n>> ok 63 - Do not show note on other ref by default\n>>\n>> expecting success:\n>> GIT_NOTES_REF=\"refs/notes/other\" git log -1 >output &&\n>> test_cmp expect-other output\n>>\n>> ok 64 - Do show note when ref is given in GIT_NOTES_REF\n>>\n>> expecting success:\n>> test_config core.notesRef \"refs/notes/other\" &&\n>> git log -1 >output &&\n>> test_cmp expect-other output\n>>\n>> ok 65 - Do show note when ref is given in core.notesRef config\n>>\n>> expecting success:\n>> test_config core.notesRef \"refs/notes/other\" &&\n>> GIT_NOTES_REF=\"refs/notes/wrong\" git log -1 >output &&\n>> test_cmp expect-not-other output\n>>\n>> ok 66 - Do not show note when core.notesRef is overridden\n>>\n>> expecting success:\n>> cat >expect-both <<-EOF &&\n>> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:18:13 2005 -0700\n>>\n>> ${indent}6th\n>>\n>> Notes:\n>> ${indent}order test\n>>\n>> Notes (other):\n>> ${indent}other note\n>>\n>> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:17:13 2005 -0700\n>>\n>> ${indent}5th\n>>\n>> Notes:\n>> ${indent}replacement for deleted note\n>> EOF\n>> GIT_NOTES_REF=refs/notes/commits git notes add \\\n>> -m\"replacement for deleted note\" HEAD^ &&\n>> GIT_NOTES_REF=refs/notes/commits git notes add -m\"order test\" &&\n>> test_unconfig core.notesRef &&\n>> test_config notes.displayRef \"refs/notes/*\" &&\n>> git log -2 >output &&\n>> test_cmp expect-both output\n>>\n>> ok 67 - Show all notes when notes.displayRef=refs/notes/*\n>>\n>> expecting success:\n>> test_config core.notesRef refs/notes/commits &&\n>> test_config notes.displayRef refs/notes/other &&\n>> git log -2 >output &&\n>> test_cmp expect-both output\n>>\n>> ok 68 - core.notesRef is implicitly in notes.displayRef\n>>\n>> expecting success:\n>> test_unconfig core.notesRef &&\n>> test_config notes.displayRef refs/notes/commits &&\n>> git config --add notes.displayRef refs/notes/other &&\n>> git log -2 >output &&\n>> test_cmp expect-both output\n>>\n>> ok 69 - notes.displayRef can be given more than once\n>>\n>> expecting success:\n>> cat >expect-both-reversed <<-EOF &&\n>> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:18:13 2005 -0700\n>>\n>> ${indent}6th\n>>\n>> Notes (other):\n>> ${indent}other note\n>>\n>> Notes:\n>> ${indent}order test\n>> EOF\n>> test_config core.notesRef refs/notes/other &&\n>> test_config notes.displayRef refs/notes/commits &&\n>> git log -1 >output &&\n>> test_cmp expect-both-reversed output\n>>\n>> ok 70 - notes.displayRef respects order\n>>\n>> expecting success:\n>> GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n>> git log -2 >output &&\n>> test_cmp expect-both output\n>>\n>> ok 71 - GIT_NOTES_DISPLAY_REF works\n>>\n>> expecting success:\n>> cat >expect-none <<-EOF &&\n>> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:18:13 2005 -0700\n>>\n>> ${indent}6th\n>>\n>> commit 7f9ad8836c775acb134c0a055fc55fb4cd1ba361\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:17:13 2005 -0700\n>>\n>> ${indent}5th\n>> EOF\n>> test_config notes.displayRef \"refs/notes/*\" &&\n>> GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >output &&\n>> test_cmp expect-none output\n>>\n>> ok 72 - GIT_NOTES_DISPLAY_REF overrides config\n>>\n>> expecting success:\n>> GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >output &&\n>> test_cmp expect-both output\n>>\n>> ok 73 - --show-notes=* adds to GIT_NOTES_DISPLAY_REF\n>>\n>> expecting success:\n>> cat >expect-commits <<EOF\n>> commit 2c125331118caba0ff8238b7f4958ac6e93fe39c\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:18:13 2005 -0700\n>>\n>> ${indent}6th\n>>\n>> Notes:\n>> ${indent}order test\n>> EOF\n>> git log --no-standard-notes --show-notes=commits -1 >output &&\n>> test_cmp expect-commits output\n>>\n>> ok 74 - --no-standard-notes\n>>\n>> expecting success:\n>> test_config notes.displayRef \"refs/notes/*\" &&\n>> git log --no-standard-notes --show-notes=commits \\\n>> --standard-notes -2 >output &&\n>> test_cmp expect-both output\n>>\n>> ok 75 - --standard-notes\n>>\n>> expecting success:\n>> git log --show-notes=other --show-notes=commits \\\n>> --no-standard-notes -1 >output &&\n>> test_cmp expect-both-reversed output\n>>\n>> ok 76 - --show-notes=ref accumulates\n>>\n>> expecting success:\n>> test_config core.notesRef refs/notes/other &&\n>> echo \"Note on a tree\" >expect &&\n>> git notes add -m \"Note on a tree\" HEAD: &&\n>> git notes show HEAD: >actual &&\n>> test_cmp expect actual &&\n>> echo \"Note on a blob\" >expect &&\n>> filename=$(git ls-tree --name-only HEAD | head -n1) &&\n>> git notes add -m \"Note on a blob\" HEAD:$filename &&\n>> git notes show HEAD:$filename >actual &&\n>> test_cmp expect actual &&\n>> echo \"Note on a tag\" >expect &&\n>> git tag -a -m \"This is an annotated tag\" foobar HEAD^ &&\n>> git notes add -m \"Note on a tag\" foobar &&\n>> git notes show foobar >actual &&\n>> test_cmp expect actual\n>>\n>> ok 77 - Allow notes on non-commits (trees, blobs, tags)\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit fb01e0ca8c33b6cc0c6451dde747f97df567cb5c\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:19:13 2005 -0700\n>>\n>> ${indent}7th\n>>\n>> Notes:\n>> ${indent}order test\n>> EOF\n>> test_commit 7th &&\n>> git notes add -C $(git notes list HEAD^) &&\n>> git log -1 >actual &&\n>> test_cmp expect actual &&\n>> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n>>\n>> [master fb01e0c] 7th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 7th.t\n>> ok 78 - create note from other note with \"git notes add -C\"\n>>\n>> expecting success:\n>> test_commit 8th &&\n>> test_must_fail git notes add -C deadbeef &&\n>> test_must_fail git notes list HEAD\n>>\n>> [master 9a4c31c] 8th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 8th.t\n>> fatal: Failed to resolve 'deadbeef' as a valid ref.\n>> error: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.\n>> ok 79 - create note from non-existing note with \"git notes add -C\" fails\n>>\n>> expecting success:\n>> commit=$(git rev-parse --verify HEAD) &&\n>> tree=$(git rev-parse --verify HEAD:) &&\n>> test_must_fail git notes add -C $commit &&\n>> test_must_fail git notes add -C $tree &&\n>> test_must_fail git notes list HEAD\n>>\n>> fatal: Cannot read note data from non-blob object\n>> '9a4c31c7f722b5d517e92c64e932dd751e1413bf'.\n>> fatal: Cannot read note data from non-blob object\n>> '37f6454412e4ed89ae47782f956ed0fb573892f6'.\n>> error: No note found for object 9a4c31c7f722b5d517e92c64e932dd751e1413bf.\n>> ok 80 - create note from non-blob with \"git notes add -C\" fails\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 9a4c31c7f722b5d517e92c64e932dd751e1413bf\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:20:13 2005 -0700\n>>\n>> ${indent}8th\n>>\n>> Notes:\n>> ${indent}This is a blob object\n>> EOF\n>> blob=$(echo \"This is a blob object\" | git hash-object -w --stdin) &&\n>> git notes add -C $blob &&\n>> git log -1 >actual &&\n>> test_cmp expect actual &&\n>> test \"$(git notes list HEAD)\" = \"$blob\"\n>>\n>> ok 81 - create note from blob with \"git notes add -C\" reuses blob id\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:21:13 2005 -0700\n>>\n>> ${indent}9th\n>>\n>> Notes:\n>> ${indent}yet another note\n>> EOF\n>> test_commit 9th &&\n>> MSG=\"yet another note\" git notes add -c $(git notes list HEAD^^) &&\n>> git log -1 >actual &&\n>> test_cmp expect actual\n>>\n>> [master 2e0db4b] 9th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 9th.t\n>> yet another note\n>> ok 82 - create note from other note with \"git notes add -c\"\n>>\n>> expecting success:\n>> test_commit 10th &&\n>> test_must_fail env MSG=\"yet another note\" git notes add -c deadbeef &&\n>> test_must_fail git notes list HEAD\n>>\n>> [master 7c3b87a] 10th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 10th.t\n>> fatal: Failed to resolve 'deadbeef' as a valid ref.\n>> error: No note found for object 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406.\n>> ok 83 - create note from non-existing note with \"git notes add -c\" fails\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 2e0db4bc649e174d667a1cde19e725cf897a5bd2\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:21:13 2005 -0700\n>>\n>> ${indent}9th\n>>\n>> Notes:\n>> ${indent}yet another note\n>> ${indent}\n>> ${indent}yet another note\n>> EOF\n>> git notes append -C $(git notes list HEAD^) HEAD^ &&\n>> git log -1 HEAD^ >actual &&\n>> test_cmp expect actual\n>>\n>> ok 84 - append to note from other note with \"git notes append -C\"\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:22:13 2005 -0700\n>>\n>> ${indent}10th\n>>\n>> Notes:\n>> ${indent}other note\n>> EOF\n>> MSG=\"other note\" git notes append -c $(git notes list HEAD^) &&\n>> git log -1 >actual &&\n>> test_cmp expect actual\n>>\n>> other note\n>> ok 85 - create note from other note with \"git notes append -c\"\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 7c3b87ab368f81e11b1ea87b2ab99a71ccd25406\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:22:13 2005 -0700\n>>\n>> ${indent}10th\n>>\n>> Notes:\n>> ${indent}other note\n>> ${indent}\n>> ${indent}yet another note\n>> EOF\n>> MSG=\"yet another note\" git notes append -c $(git notes list HEAD) &&\n>> git log -1 >actual &&\n>> test_cmp expect actual\n>>\n>> yet another note\n>> ok 86 - append to note from other note with \"git notes append -c\"\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:23:13 2005 -0700\n>>\n>> ${indent}11th\n>>\n>> Notes:\n>> ${indent}other note\n>> ${indent}\n>> ${indent}yet another note\n>> EOF\n>> test_commit 11th &&\n>> git notes copy HEAD^ HEAD &&\n>> git log -1 >actual &&\n>> test_cmp expect actual &&\n>> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n>>\n>> [master a446fff] 11th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 11th.t\n>> ok 87 - copy note with \"git notes copy\"\n>>\n>> expecting success:\n>> test_must_fail git notes copy HEAD~2 HEAD &&\n>> git log -1 >actual &&\n>> test_cmp expect actual &&\n>> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD^)\"\n>>\n>> error: Cannot copy notes. Found existing notes for object\n>> a446fff8777efdc6eb8f4b7c8a5ff699484df0d5. Use '-f' to overwrite\n>> existing notes\n>> ok 88 - prevent overwrite with \"git notes copy\"\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:23:13 2005 -0700\n>>\n>> ${indent}11th\n>>\n>> Notes:\n>> ${indent}yet another note\n>> ${indent}\n>> ${indent}yet another note\n>> EOF\n>> git notes copy -f HEAD~2 HEAD &&\n>> git log -1 >actual &&\n>> test_cmp expect actual &&\n>> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD~2)\"\n>>\n>> Overwriting existing notes for object a446fff8777efdc6eb8f4b7c8a5ff699484df0d5\n>> ok 89 - allow overwrite with \"git notes copy -f\"\n>>\n>> expecting success:\n>> test_commit 12th &&\n>> test_commit 13th &&\n>> test_must_fail git notes copy HEAD^ HEAD\n>>\n>> [master 65e263d] 12th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 12th.t\n>> [master e871aa6] 13th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 13th.t\n>> error: Missing notes on source object\n>> 65e263ded02ae4e8839bc151095113737579dc12. Cannot copy.\n>> ok 90 - cannot copy note from object without notes\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit e871aa61182b1d95d0a6fb75445d891722863b6b\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:25:13 2005 -0700\n>>\n>> ${indent}13th\n>>\n>> Notes:\n>> ${indent}yet another note\n>> ${indent}\n>> ${indent}yet another note\n>>\n>> commit 65e263ded02ae4e8839bc151095113737579dc12\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:24:13 2005 -0700\n>>\n>> ${indent}12th\n>>\n>> Notes:\n>> ${indent}other note\n>> ${indent}\n>> ${indent}yet another note\n>> EOF\n>> (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n>> echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n>> git notes copy --stdin &&\n>> git log -2 >output &&\n>> test_cmp expect output &&\n>> test \"$(git notes list HEAD)\" = \"$(git notes list HEAD~2)\" &&\n>> test \"$(git notes list HEAD^)\" = \"$(git notes list HEAD~3)\"\n>>\n>> ok 91 - git notes copy --stdin\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> commit 07c85d77059393ed0154b8c96906547a59dfcddd\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:26:13 2005 -0700\n>>\n>> ${indent}14th\n>> EOF\n>> test_commit 14th &&\n>> test_commit 15th &&\n>> (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n>> echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -2 >output &&\n>> test_cmp expect output\n>>\n>> [master 07c85d7] 14th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 14th.t\n>> [master 4acf42e] 15th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 15th.t\n>> ok 92 - git notes copy --for-rewrite (unconfigured)\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> Notes:\n>> ${indent}yet another note\n>> ${indent}\n>> ${indent}yet another note\n>>\n>> commit 07c85d77059393ed0154b8c96906547a59dfcddd\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:26:13 2005 -0700\n>>\n>> ${indent}14th\n>>\n>> Notes:\n>> ${indent}other note\n>> ${indent}\n>> ${indent}yet another note\n>> EOF\n>> test_config notes.rewriteMode overwrite &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> (echo $(git rev-parse HEAD~3) $(git rev-parse HEAD^); \\\n>> echo $(git rev-parse HEAD~2) $(git rev-parse HEAD)) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -2 >output &&\n>> test_cmp expect output\n>>\n>> ok 93 - git notes copy --for-rewrite (enabled)\n>>\n>> expecting success:\n>> test_config notes.rewrite.bar false &&\n>> echo $(git rev-parse HEAD~3) $(git rev-parse HEAD) |\n>> git notes copy --for-rewrite=bar &&\n>> git log -2 >output &&\n>> test_cmp expect output\n>>\n>> ./test-lib.sh: line 536: echo: write error: Broken pipe\n>> ok 94 - git notes copy --for-rewrite (disabled)\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> Notes:\n>> ${indent}a fresh note\n>> EOF\n>> git notes add -f -m\"a fresh note\" HEAD^ &&\n>> test_config notes.rewriteMode overwrite &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n>> ok 95 - git notes copy --for-rewrite (overwrite)\n>>\n>> expecting success:\n>> test_config notes.rewriteMode ignore &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> ok 96 - git notes copy --for-rewrite (ignore)\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> Notes:\n>> ${indent}a fresh note\n>> ${indent}\n>> ${indent}another fresh note\n>> EOF\n>> git notes add -f -m\"another fresh note\" HEAD^ &&\n>> test_config notes.rewriteMode concatenate &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n>> ok 97 - git notes copy --for-rewrite (append)\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> Notes:\n>> ${indent}a fresh note\n>> ${indent}\n>> ${indent}another fresh note\n>> ${indent}\n>> ${indent}append 1\n>> ${indent}\n>> ${indent}append 2\n>> EOF\n>> git notes add -f -m\"append 1\" HEAD^ &&\n>> git notes add -f -m\"append 2\" HEAD^^ &&\n>> test_config notes.rewriteMode concatenate &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> (echo $(git rev-parse HEAD^) $(git rev-parse HEAD);\n>> echo $(git rev-parse HEAD^^) $(git rev-parse HEAD)) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n>> Overwriting existing notes for object e871aa61182b1d95d0a6fb75445d891722863b6b\n>> ok 98 - git notes copy --for-rewrite (append two to one)\n>>\n>> expecting success:\n>> git notes remove HEAD^ &&\n>> test_config notes.rewriteMode concatenate &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> Removing note for object HEAD^\n>> ok 99 - git notes copy --for-rewrite (append empty)\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> Notes:\n>> ${indent}replacement note 1\n>> EOF\n>> test_config notes.rewriteMode concatenate &&\n>> test_config notes.rewriteRef \"refs/notes/*\" &&\n>> git notes add -f -m\"replacement note 1\" HEAD^ &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> GIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> ok 100 - GIT_NOTES_REWRITE_MODE works\n>>\n>> expecting success:\n>> cat >expect <<-EOF &&\n>> commit 4acf42e847e7fffbbf89ee365c20ac7caf40de89\n>> Author: A U Thor <author@example.com>\n>> Date:   Thu Apr 7 15:27:13 2005 -0700\n>>\n>> ${indent}15th\n>>\n>> Notes:\n>> ${indent}replacement note 2\n>> EOF\n>> git notes add -f -m\"replacement note 2\" HEAD^ &&\n>> test_config notes.rewriteMode overwrite &&\n>> test_unconfig notes.rewriteRef &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> GIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \\\n>> git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n>> ok 101 - GIT_NOTES_REWRITE_REF works\n>>\n>> expecting success:\n>> git notes add -f -m\"replacement note 3\" HEAD^ &&\n>> test_config notes.rewriteMode overwrite &&\n>> test_config notes.rewriteRef refs/notes/other &&\n>> echo $(git rev-parse HEAD^) $(git rev-parse HEAD) |\n>> GIT_NOTES_REWRITE_REF= git notes copy --for-rewrite=foo &&\n>> git log -1 >output &&\n>> test_cmp expect output\n>>\n>> Overwriting existing notes for object 07c85d77059393ed0154b8c96906547a59dfcddd\n>> ./test-lib.sh: line 538: echo: write error: Broken pipe\n>> ok 102 - GIT_NOTES_REWRITE_REF overrides config\n>>\n>> expecting success:\n>> test_must_fail git notes copy &&\n>> test_must_fail git notes copy one two three\n>>\n>> error: too few parameters\n>> usage: git notes copy [<options>] <from-object> <to-object>\n>>    or: git notes copy --stdin [<from-object> <to-object>]...\n>>\n>>     -f, --force           replace existing notes\n>>     --stdin               read objects from stdin\n>>     --for-rewrite <command>\n>>                           load rewriting config for <command> (implies --stdin)\n>>\n>> error: too many parameters\n>> usage: git notes copy [<options>] <from-object> <to-object>\n>>    or: git notes copy --stdin [<from-object> <to-object>]...\n>>\n>>     -f, --force           replace existing notes\n>>     --stdin               read objects from stdin\n>>     --for-rewrite <command>\n>>                           load rewriting config for <command> (implies --stdin)\n>>\n>> ok 103 - git notes copy diagnoses too many or too few parameters\n>>\n>> expecting success:\n>> test_unconfig core.notesRef &&\n>> sane_unset GIT_NOTES_REF &&\n>> test \"$(git notes get-ref)\" = \"refs/notes/commits\"\n>>\n>> ok 104 - git notes get-ref (no overrides)\n>>\n>> expecting success:\n>> test_config core.notesRef refs/notes/foo &&\n>> test \"$(git notes get-ref)\" = \"refs/notes/foo\"\n>>\n>> ok 105 - git notes get-ref (core.notesRef)\n>>\n>> expecting success:\n>> test \"$(GIT_NOTES_REF=refs/notes/bar git notes get-ref)\" = \"refs/notes/bar\"\n>>\n>> ok 106 - git notes get-ref (GIT_NOTES_REF)\n>>\n>> expecting success:\n>> test \"$(GIT_NOTES_REF=refs/notes/bar git notes --ref=baz get-ref)\" =\n>> \"refs/notes/baz\"\n>>\n>> ok 107 - git notes get-ref (--ref)\n>>\n>> expecting success:\n>> test_unconfig core.notesRef &&\n>> test_commit 16th &&\n>> empty_blob=$(git hash-object -w /dev/null) &&\n>> echo \"$empty_blob\" >expect_empty\n>>\n>> [master 21d0abc] 16th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 16th.t\n>> ok 108 - setup testing of empty notes\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add &&\n>> test_must_fail git notes list HEAD\n>>\n>> Object HEAD has no note\n>>\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 109 - 'git notes add' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>>\n>> ok 110 - 'git notes add --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -F /dev/null &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 111 - 'git notes add -F /dev/null' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -F /dev/null --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>> ok 112 - 'git notes add -F /dev/null --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -m \"\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 113 - 'git notes add -m \"\"' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -m \"\" --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>> ok 114 - 'git notes add -m \"\" --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -c \"$empty_blob\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>>\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 115 - 'git notes add -c \"$empty_blob\"' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -c \"$empty_blob\" --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>>\n>> ok 116 - 'git notes add -c \"$empty_blob\" --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -C \"$empty_blob\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 117 - 'git notes add -C \"$empty_blob\"' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes add -C \"$empty_blob\" --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>> ok 118 - 'git notes add -C \"$empty_blob\" --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>>\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 119 - 'git notes append' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>>\n>> ok 120 - 'git notes append --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -F /dev/null &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 121 - 'git notes append -F /dev/null' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -F /dev/null --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>> ok 122 - 'git notes append -F /dev/null --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -m \"\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 123 - 'git notes append -m \"\"' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -m \"\" --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>> ok 124 - 'git notes append -m \"\" --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -c \"$empty_blob\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>>\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 125 - 'git notes append -c \"$empty_blob\"' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -c \"$empty_blob\" --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>>\n>> ok 126 - 'git notes append -c \"$empty_blob\" --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -C \"$empty_blob\" &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 127 - 'git notes append -C \"$empty_blob\"' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes append -C \"$empty_blob\" --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>> ok 128 - 'git notes append -C \"$empty_blob\" --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes edit &&\n>> test_must_fail git notes list HEAD\n>>\n>> Removing note for object HEAD\n>>\n>> Removing note for object 21d0abcd10f591529d5148ae8bc7703fc1f73398\n>> error: No note found for object 21d0abcd10f591529d5148ae8bc7703fc1f73398.\n>> ok 129 - 'git notes edit' removes empty note\n>>\n>> expecting success:\n>> test_might_fail git notes remove HEAD &&\n>> MSG= git notes edit --allow-empty &&\n>> git notes list HEAD >actual &&\n>> test_cmp expect_empty actual\n>>\n>> Object HEAD has no note\n>>\n>> ok 130 - 'git notes edit --allow-empty' stores empty note\n>>\n>> expecting success:\n>> test_commit 17th &&\n>> git log -1 >expect &&\n>> cat >>expect <<-EOF &&\n>>\n>> Notes:\n>> EOF\n>> git notes add -C \"$empty_blob\" --allow-empty &&\n>> git log -1 >actual &&\n>> test_cmp expect actual\n>>\n>> [master 27a79f3] 17th\n>>  Author: A U Thor <author@example.com>\n>>  1 file changed, 1 insertion(+)\n>>  create mode 100644 17th.t\n>> ok 131 - empty notes are displayed by git log\n>>\n>> # failed 6 among 131 test(s)\n>> 1..131\n"},{"id":"251703","messageId":"CAPig+cRxCj82F5aak0Y+Ce_SvUETtQ5dwM1RtzjUUvwtJ=WPYw@mail.gmail.com","threadId":"37929","inReplyTo":"CAO2U3QhiWVvVKivBhE5R2xhjf8SPPtg6VSaQMxw7vbm_454jBQ@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2014-11-11T01:19:29Z","receivedAt":"2014-11-11T01:19:29Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Nov 10, 2014 at 7:17 PM, Michael Blume <blume.mike@gmail.com> wrote:\n> the commit modernizing test 3301\n> (https://github.com/git/git/commit/fbe4f74865acfd) appears to break it\n> on my mac\n>\n> $ ./t3301-notes.sh -v\n> expecting success:\n> MSG=b4 git notes add &&\n> test_path_is_missing .git/NOTES_EDITMSG &&\n> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> test \"b4\" = \"$(git notes show)\" &&\n> git show HEAD^ &&\n> test_must_fail git notes show HEAD^\n>\n> b4\n> not ok 8 - create notes\n\nThis and all other failures are due to the output of 'wc -l', which on\nMac is \"{whitespace}1\" rather than just \"1\" as it is on other\nplatforms. fbe4f748 added quotes around the $(... | wc -l) invocation\nwhich caused the whitespace to be retained. A minimum fix would be to\ndrop the quotes surrounding $().\n"},{"id":"251704","messageId":"CALKQrgexnrCy-P6yTZB+U0--5peaTys9KqB+KGKqbAuyLA=NqA@mail.gmail.com","threadId":"37929","inReplyTo":"CAPig+cRxCj82F5aak0Y+Ce_SvUETtQ5dwM1RtzjUUvwtJ=WPYw@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2014-11-11T01:40:19Z","receivedAt":"2014-11-11T01:40:19Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tue, Nov 11, 2014 at 2:19 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Mon, Nov 10, 2014 at 7:17 PM, Michael Blume <blume.mike@gmail.com> wrote:\n>> the commit modernizing test 3301\n>> (https://github.com/git/git/commit/fbe4f74865acfd) appears to break it\n>> on my mac\n>>\n>> $ ./t3301-notes.sh -v\n>> expecting success:\n>> MSG=b4 git notes add &&\n>> test_path_is_missing .git/NOTES_EDITMSG &&\n>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>> test \"b4\" = \"$(git notes show)\" &&\n>> git show HEAD^ &&\n>> test_must_fail git notes show HEAD^\n>>\n>> b4\n>> not ok 8 - create notes\n>\n> This and all other failures are due to the output of 'wc -l', which on\n> Mac is \"{whitespace}1\" rather than just \"1\" as it is on other\n> platforms. fbe4f748 added quotes around the $(... | wc -l) invocation\n> which caused the whitespace to be retained. A minimum fix would be to\n> drop the quotes surrounding $().\n\nAh, thanks!\n\nI thought that quoting command output was a good idea in general. Am I\nwrong, or is this just one exception to an otherwise good guideline?\n\nAnyway, here is the minimal diff to remove quoting from the $(... | wc\n-l) commands (probably whitespace damaged by GMail - sorry). Junio:\nfeel free to squash this in, or ask for a re-roll:\n\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex cd756ec..2c8abbc 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -52,7 +52,7 @@ test_expect_success 'show non-existent notes entry with %N' '\n test_expect_success 'create notes' '\n     MSG=b4 git notes add &&\n     test_path_is_missing .git/NOTES_EDITMSG &&\n-    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n+    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n     test \"b4\" = \"$(git notes show)\" &&\n     git show HEAD^ &&\n     test_must_fail git notes show HEAD^\n@@ -75,7 +75,7 @@ test_expect_success 'create reflog entry' '\n test_expect_success 'edit existing notes' '\n     MSG=b3 git notes edit &&\n     test_path_is_missing .git/NOTES_EDITMSG &&\n-    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n+    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n     test \"b3\" = \"$(git notes show)\" &&\n     git show HEAD^ &&\n     test_must_fail git notes show HEAD^\n@@ -84,7 +84,7 @@ test_expect_success 'edit existing notes' '\n test_expect_success 'cannot \"git notes add -m\" where notes already exists' '\n     test_must_fail git notes add -m \"b2\" &&\n     test_path_is_missing .git/NOTES_EDITMSG &&\n-    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n+    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n     test \"b3\" = \"$(git notes show)\" &&\n     git show HEAD^ &&\n     test_must_fail git notes show HEAD^\n@@ -93,7 +93,7 @@ test_expect_success 'cannot \"git notes add -m\" where\nnotes already exists' '\n test_expect_success 'can overwrite existing note with \"git notes add -f -m\"' '\n     git notes add -f -m \"b1\" &&\n     test_path_is_missing .git/NOTES_EDITMSG &&\n-    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n+    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n     test \"b1\" = \"$(git notes show)\" &&\n     git show HEAD^ &&\n     test_must_fail git notes show HEAD^\n@@ -102,7 +102,7 @@ test_expect_success 'can overwrite existing note\nwith \"git notes add -f -m\"' '\n test_expect_success 'add w/no options on existing note morphs into edit' '\n     MSG=b2 git notes add &&\n     test_path_is_missing .git/NOTES_EDITMSG &&\n-    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n+    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n     test \"b2\" = \"$(git notes show)\" &&\n     git show HEAD^ &&\n     test_must_fail git notes show HEAD^\n@@ -111,7 +111,7 @@ test_expect_success 'add w/no options on existing\nnote morphs into edit' '\n test_expect_success 'can overwrite existing note with \"git notes add -f\"' '\n     MSG=b1 git notes add -f &&\n     test_path_is_missing .git/NOTES_EDITMSG &&\n-    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n+    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n     test \"b1\" = \"$(git notes show)\" &&\n     git show HEAD^ &&\n     test_must_fail git notes show HEAD^\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"251705","messageId":"CAO2U3Qh1dpmwhfhMCbSrUXKZ+hby2Ku_Qm-wvxPThzBeL+kXXA@mail.gmail.com","threadId":"37929","inReplyTo":"CALKQrgexnrCy-P6yTZB+U0--5peaTys9KqB+KGKqbAuyLA=NqA@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Michael Blume","fromEmail":"blume.mike@gmail.com","sentAt":"2014-11-11T01:46:44Z","receivedAt":"2014-11-11T01:46:44Z","isPatch":false,"sender":{"key":"blume.mike@gmail.com","avatar":"https://gravatar.com/avatar/1a7b440e1d942425ff4098ac7fc15b86b30cecaa56e1692a7ef8b5939ba25ea7?d=mp&s=160"},"body":"If quoting is generally preferred as a best practice, we could force\nwc to behave more consistently before we start testing\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 0d93e33..57ed608 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -515,6 +515,14 @@ test_path_is_missing () {\n  fi\n }\n\n+# Some platforms disagree about wc output format.\n+\n+SYS_WC=$(which wc)\n+\n+wc () {\n+ $SYS_WC $@ | sed -e 's/^ *//' -e 's/ *$//'\n+}\n+\n # test_line_count checks that a file has the number of lines it\n # ought to. For example:\n #\n\nOn Mon, Nov 10, 2014 at 5:40 PM, Johan Herland <johan@herland.net> wrote:\n> On Tue, Nov 11, 2014 at 2:19 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:\n>> On Mon, Nov 10, 2014 at 7:17 PM, Michael Blume <blume.mike@gmail.com> wrote:\n>>> the commit modernizing test 3301\n>>> (https://github.com/git/git/commit/fbe4f74865acfd) appears to break it\n>>> on my mac\n>>>\n>>> $ ./t3301-notes.sh -v\n>>> expecting success:\n>>> MSG=b4 git notes add &&\n>>> test_path_is_missing .git/NOTES_EDITMSG &&\n>>> test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n>>> test \"b4\" = \"$(git notes show)\" &&\n>>> git show HEAD^ &&\n>>> test_must_fail git notes show HEAD^\n>>>\n>>> b4\n>>> not ok 8 - create notes\n>>\n>> This and all other failures are due to the output of 'wc -l', which on\n>> Mac is \"{whitespace}1\" rather than just \"1\" as it is on other\n>> platforms. fbe4f748 added quotes around the $(... | wc -l) invocation\n>> which caused the whitespace to be retained. A minimum fix would be to\n>> drop the quotes surrounding $().\n>\n> Ah, thanks!\n>\n> I thought that quoting command output was a good idea in general. Am I\n> wrong, or is this just one exception to an otherwise good guideline?\n>\n> Anyway, here is the minimal diff to remove quoting from the $(... | wc\n> -l) commands (probably whitespace damaged by GMail - sorry). Junio:\n> feel free to squash this in, or ask for a re-roll:\n>\n> diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\n> index cd756ec..2c8abbc 100755\n> --- a/t/t3301-notes.sh\n> +++ b/t/t3301-notes.sh\n> @@ -52,7 +52,7 @@ test_expect_success 'show non-existent notes entry with %N' '\n>  test_expect_success 'create notes' '\n>      MSG=b4 git notes add &&\n>      test_path_is_missing .git/NOTES_EDITMSG &&\n> -    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> +    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n>      test \"b4\" = \"$(git notes show)\" &&\n>      git show HEAD^ &&\n>      test_must_fail git notes show HEAD^\n> @@ -75,7 +75,7 @@ test_expect_success 'create reflog entry' '\n>  test_expect_success 'edit existing notes' '\n>      MSG=b3 git notes edit &&\n>      test_path_is_missing .git/NOTES_EDITMSG &&\n> -    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> +    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n>      test \"b3\" = \"$(git notes show)\" &&\n>      git show HEAD^ &&\n>      test_must_fail git notes show HEAD^\n> @@ -84,7 +84,7 @@ test_expect_success 'edit existing notes' '\n>  test_expect_success 'cannot \"git notes add -m\" where notes already exists' '\n>      test_must_fail git notes add -m \"b2\" &&\n>      test_path_is_missing .git/NOTES_EDITMSG &&\n> -    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> +    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n>      test \"b3\" = \"$(git notes show)\" &&\n>      git show HEAD^ &&\n>      test_must_fail git notes show HEAD^\n> @@ -93,7 +93,7 @@ test_expect_success 'cannot \"git notes add -m\" where\n> notes already exists' '\n>  test_expect_success 'can overwrite existing note with \"git notes add -f -m\"' '\n>      git notes add -f -m \"b1\" &&\n>      test_path_is_missing .git/NOTES_EDITMSG &&\n> -    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> +    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n>      test \"b1\" = \"$(git notes show)\" &&\n>      git show HEAD^ &&\n>      test_must_fail git notes show HEAD^\n> @@ -102,7 +102,7 @@ test_expect_success 'can overwrite existing note\n> with \"git notes add -f -m\"' '\n>  test_expect_success 'add w/no options on existing note morphs into edit' '\n>      MSG=b2 git notes add &&\n>      test_path_is_missing .git/NOTES_EDITMSG &&\n> -    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> +    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n>      test \"b2\" = \"$(git notes show)\" &&\n>      git show HEAD^ &&\n>      test_must_fail git notes show HEAD^\n> @@ -111,7 +111,7 @@ test_expect_success 'add w/no options on existing\n> note morphs into edit' '\n>  test_expect_success 'can overwrite existing note with \"git notes add -f\"' '\n>      MSG=b1 git notes add -f &&\n>      test_path_is_missing .git/NOTES_EDITMSG &&\n> -    test \"1\" = \"$(git ls-tree refs/notes/commits | wc -l)\" &&\n> +    test \"1\" = $(git ls-tree refs/notes/commits | wc -l) &&\n>      test \"b1\" = \"$(git notes show)\" &&\n>      git show HEAD^ &&\n>      test_must_fail git notes show HEAD^\n>\n>\n> ...Johan\n>\n> --\n> Johan Herland, <johan@herland.net>\n> www.herland.net\n"},{"id":"251708","messageId":"20141111024128.GA21328@peff.net","threadId":"37929","inReplyTo":"CALKQrgexnrCy-P6yTZB+U0--5peaTys9KqB+KGKqbAuyLA=NqA@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-11-11T02:41:29Z","receivedAt":"2014-11-11T02:41:29Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 11, 2014 at 02:40:19AM +0100, Johan Herland wrote:\n\n> > This and all other failures are due to the output of 'wc -l', which on\n> > Mac is \"{whitespace}1\" rather than just \"1\" as it is on other\n> > platforms. fbe4f748 added quotes around the $(... | wc -l) invocation\n> > which caused the whitespace to be retained. A minimum fix would be to\n> > drop the quotes surrounding $().\n> \n> Ah, thanks!\n> \n> I thought that quoting command output was a good idea in general. Am I\n> wrong, or is this just one exception to an otherwise good guideline?\n\nIt usually is a good idea to prevent whitespace splitting by the shell\n(and especially with things that might unexpectedly be empty, in which\ncase they end up as \"no argument\" and not an empty one). So yeah, this\nis an exception.\n\n> Anyway, here is the minimal diff to remove quoting from the $(... | wc\n> -l) commands (probably whitespace damaged by GMail - sorry). Junio:\n> feel free to squash this in, or ask for a re-roll:\n\nI think we have test_line_count exactly because of this unportability\nwith wc output.\n\nYou'd want:\n\n  git ls-tree refs/notes/commits >actual &&\n  test_line_count = 1 actual\n\nor similar.\n\nBy the way, the point of that \"ls-tree\" appears to be to check the\nnumber of total notes stored. Since notes are stored in a hashed\nstructure, should it be \"ls-tree -r\"? Otherwise, we see only the leading\ndirectories; two notes whose sha1s start with the same two characters\nwould be considered a single entry.\n\n-Peff\n"},{"id":"251719","messageId":"xmqqmw7x7mpw.fsf@gitster.dls.corp.google.com","threadId":"37929","inReplyTo":"CALKQrgexnrCy-P6yTZB+U0--5peaTys9KqB+KGKqbAuyLA=NqA@mail.gmail.com","subject":"Re: mac test failure -- test 3301","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-11T15:58:51Z","receivedAt":"2014-11-11T15:58:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johan Herland <johan@herland.net> writes:\n\n> Ah, thanks!\n>\n> I thought that quoting command output was a good idea in general. Am I\n> wrong, or is this just one exception to an otherwise good guideline?\n\nIt is not a good practice to blindly follow any guideline ;-).\n\nWhen you anticipate that different platforms throw you unnecessary\nspaces around a single token you expect to see, not quoting is\nobviously the right thing.  If you are unsure if the comamand gives\nyou one or multiple tokens, you obviously risk the output getting\nsplit by not quoting.\n"},{"id":"251732","messageId":"CALKQrgfaWett4zWRW3R8sKi8OOfq4_RnD8gMXhENjw_kmgGQ0w@mail.gmail.com","threadId":"37929","inReplyTo":"20141111024128.GA21328@peff.net","subject":"Re: mac test failure -- test 3301","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2014-11-11T23:57:53Z","receivedAt":"2014-11-11T23:57:53Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tue, Nov 11, 2014 at 3:41 AM, Jeff King <peff@peff.net> wrote:\n> On Tue, Nov 11, 2014 at 02:40:19AM +0100, Johan Herland wrote:\n>> > This and all other failures are due to the output of 'wc -l', which on\n>> > Mac is \"{whitespace}1\" rather than just \"1\" as it is on other\n>> > platforms. fbe4f748 added quotes around the $(... | wc -l) invocation\n>> > which caused the whitespace to be retained. A minimum fix would be to\n>> > drop the quotes surrounding $().\n>>\n>> Ah, thanks!\n>>\n>> I thought that quoting command output was a good idea in general. Am I\n>> wrong, or is this just one exception to an otherwise good guideline?\n>\n> It usually is a good idea to prevent whitespace splitting by the shell\n> (and especially with things that might unexpectedly be empty, in which\n> case they end up as \"no argument\" and not an empty one). So yeah, this\n> is an exception.\n>\n>> Anyway, here is the minimal diff to remove quoting from the $(... | wc\n>> -l) commands (probably whitespace damaged by GMail - sorry). Junio:\n>> feel free to squash this in, or ask for a re-roll:\n>\n> I think we have test_line_count exactly because of this unportability\n> with wc output.\n>\n> You'd want:\n>\n>   git ls-tree refs/notes/commits >actual &&\n>   test_line_count = 1 actual\n>\n> or similar.\n\nThanks. Will use this in the re-roll.\n\n> By the way, the point of that \"ls-tree\" appears to be to check the\n> number of total notes stored. Since notes are stored in a hashed\n> structure, should it be \"ls-tree -r\"? Otherwise, we see only the leading\n> directories; two notes whose sha1s start with the same two characters\n> would be considered a single entry.\n\nYes and no... The notes' nested fanout structure is developed\ndynamically as the number of notes increase. As long as the number of\nnotes stay low, the notes tree remain at fanout level 0 (i.e. no\nnesting), so ls-tree happens to work here. Still ls-tree -r is the\ncorrect for any size notes tree. Will fix to use ls-tree -r.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}