{"thread":{"id":"56400","subject":"[PATCH 0/3] suppress trailing whitespace on empty \"notes\" lines","startedAt":"2021-08-30T07:22:53Z","lastAt":"2021-09-12T08:22:54Z","messageCount":25,"participants":["Eric Sunshine","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"434051","messageId":"20210830072118.91921-1-sunshine@sunshineco.com","threadId":"56400","inReplyTo":null,"subject":"[PATCH 0/3] suppress trailing whitespace on empty \"notes\" lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T07:21:15Z","receivedAt":"2021-08-30T07:22:53Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"This patch series fixes a problem in which `git format-patch --notes`\nand `git log` unconditionally indent _all_ \"notes\" lines, including\nthose which are empty, which ends up leaving (unwanted) trailing\nwhitespace on the previously empty lines. The first couple patches\nadjust some existing notes-related tests -- which undesirably hard-code\nthose indented blank notes lines -- to be less brittle since they would\notherwise break by the change made in the final patch which fixes the\nactual problem.\n\nEric Sunshine (3):\n  t3301: tolerate minor notes-related presentation changes\n  t3303/t9301: make `notes` tests less brittle\n  notes: don't indent empty lines\n\n notes.c                      |   2 +-\n t/t3301-notes.sh             | 321 ++++++++++++++++++-----------------\n t/t3303-notes-subtrees.sh    |  13 +-\n t/t4014-format-patch.sh      |  17 ++\n t/t9301-fast-import-notes.sh |  36 ++--\n 5 files changed, 207 insertions(+), 182 deletions(-)\n\n-- \n2.33.0.153.gba50c8fa24\n\n"},{"id":"434052","messageId":"20210830072118.91921-2-sunshine@sunshineco.com","threadId":"56400","inReplyTo":"20210830072118.91921-1-sunshine@sunshineco.com","subject":"[PATCH 1/3] t3301: tolerate minor notes-related presentation changes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T07:21:16Z","receivedAt":"2021-08-30T07:22:54Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"These tests care about whether intended notes-related functionality\noccurred and that `git log` presents the notes in the expected fashion\n(or, in some cases, that `git log` suppresses the notes). However, the\ntests hard-code the precise indentation of notes by the default `git\nlog` output, which makes them somewhat brittle since they won't be able\nto tolerate even minor changes to the presentation. Make the tests a bit\nmore robust by ignoring indentation.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n t/t3301-notes.sh | 321 ++++++++++++++++++++++++-----------------------\n 1 file changed, 162 insertions(+), 159 deletions(-)\n\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex d742be8840..955b2670a7 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -7,6 +7,11 @@ test_description='Test commit notes'\n \n . ./test-lib.sh\n \n+lognotes () {\n+\tgit log \"$@\" >lognotes.out &&\n+\tsed 's/^[ \t]*//' lognotes.out\n+}\n+\n write_script fake_editor <<\\EOF\n echo \"$MSG\" >\"$1\"\n echo \"$MSG\" >&2\n@@ -14,8 +19,6 @@ EOF\n GIT_EDITOR=./fake_editor\n export GIT_EDITOR\n \n-indent=\"    \"\n-\n test_expect_success 'cannot annotate non-existing HEAD' '\n \ttest_must_fail env MSG=3 git notes add\n '\n@@ -158,14 +161,14 @@ test_expect_success 'show notes' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:14:13 2005 -0700\n \n-\t\t${indent}2nd\n+\t\t2nd\n \n \t\tNotes:\n-\t\t${indent}b1\n+\t\tb1\n \tEOF\n \tgit cat-file commit HEAD >commits &&\n \t! grep b1 commits &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -178,16 +181,16 @@ test_expect_success 'show multi-line notes' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:15:13 2005 -0700\n \n-\t\t${indent}3rd\n+\t\t3rd\n \n \t\tNotes:\n-\t\t${indent}b3\n-\t\t${indent}c3c3c3c3\n-\t\t${indent}d3d3d3\n+\t\tb3\n+\t\tc3c3c3c3\n+\t\td3d3d3\n \n \tEOF\n \tcat expect >>expect-multiline &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect-multiline actual\n '\n \n@@ -201,21 +204,21 @@ test_expect_success 'show -F notes' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:16:13 2005 -0700\n \n-\t\t${indent}4th\n+\t\t4th\n \n \t\tNotes:\n-\t\t${indent}xyzzy\n+\t\txyzzy\n \n \tEOF\n \tcat expect-multiline >>expect-F &&\n-\tgit log -3 >actual &&\n+\tlognotes -3 >actual &&\n \ttest_cmp expect-F actual\n '\n \n test_expect_success 'Re-adding -F notes without -f fails' '\n \techo \"zyxxy\" >note5 &&\n \ttest_must_fail git notes add -F note5 &&\n-\tgit log -3 >actual &&\n+\tlognotes -3 >actual &&\n \ttest_cmp expect-F actual\n '\n \n@@ -230,9 +233,9 @@ test_expect_success 'git log --pretty=raw does not show notes' '\n \t\tauthor A U Thor <author@example.com> 1112912173 -0700\n \t\tcommitter C O Mitter <committer@example.com> 1112912173 -0700\n \n-\t\t${indent}4th\n+\t\t4th\n \tEOF\n-\tgit log -1 --pretty=raw >actual &&\n+\tlognotes -1 --pretty=raw >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -240,14 +243,14 @@ test_expect_success 'git log --show-notes' '\n \tcat >>expect <<-EOF &&\n \n \tNotes:\n-\t${indent}xyzzy\n+\txyzzy\n \tEOF\n-\tgit log -1 --pretty=raw --show-notes >actual &&\n+\tlognotes -1 --pretty=raw --show-notes >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'git log --no-notes' '\n-\tgit log -1 --no-notes >actual &&\n+\tlognotes -1 --no-notes >actual &&\n \t! grep xyzzy actual\n '\n \n@@ -280,25 +283,25 @@ test_expect_success 'setup alternate notes ref' '\n '\n \n test_expect_success 'git log --notes shows default notes' '\n-\tgit log -1 --notes >actual &&\n+\tlognotes -1 --notes >actual &&\n \tgrep xyzzy actual &&\n \t! grep alternate actual\n '\n \n test_expect_success 'git log --notes=X shows only X' '\n-\tgit log -1 --notes=alternate >actual &&\n+\tlognotes -1 --notes=alternate >actual &&\n \t! grep xyzzy actual &&\n \tgrep alternate actual\n '\n \n test_expect_success 'git log --notes --notes=X shows both' '\n-\tgit log -1 --notes --notes=alternate >actual &&\n+\tlognotes -1 --notes --notes=alternate >actual &&\n \tgrep xyzzy actual &&\n \tgrep alternate actual\n '\n \n test_expect_success 'git log --no-notes resets default state' '\n-\tgit log -1 --notes --notes=alternate \\\n+\tlognotes -1 --notes --notes=alternate \\\n \t\t--no-notes --notes=alternate \\\n \t\t>actual &&\n \t! grep xyzzy actual &&\n@@ -306,7 +309,7 @@ test_expect_success 'git log --no-notes resets default state' '\n '\n \n test_expect_success 'git log --no-notes resets ref list' '\n-\tgit log -1 --notes --notes=alternate \\\n+\tlognotes -1 --notes --notes=alternate \\\n \t\t--no-notes --notes \\\n \t\t>actual &&\n \tgrep xyzzy actual &&\n@@ -322,18 +325,18 @@ test_expect_success 'show -m notes' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n \n-\t\t${indent}5th\n+\t\t5th\n \n \t\tNotes:\n-\t\t${indent}spam\n-\t\t${indent}\n-\t\t${indent}foo\n-\t\t${indent}bar\n-\t\t${indent}baz\n+\t\tspam\n+\n+\t\tfoo\n+\t\tbar\n+\t\tbaz\n \n \tEOF\n \tcat expect-F >>expect-m &&\n-\tgit log -4 >actual &&\n+\tlognotes -4 >actual &&\n \ttest_cmp expect-m actual\n '\n \n@@ -345,18 +348,18 @@ test_expect_success 'remove note with add -f -F /dev/null' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n \n-\t\t${indent}5th\n+\t\t5th\n \n \tEOF\n \tcat expect-F >>expect-rm-F &&\n-\tgit log -4 >actual &&\n+\tlognotes -4 >actual &&\n \ttest_cmp expect-rm-F actual &&\n \ttest_must_fail git notes show\n '\n \n test_expect_success 'do not create empty note with -m \"\"' '\n \tgit notes add -m \"\" &&\n-\tgit log -4 >actual &&\n+\tlognotes -4 >actual &&\n \ttest_cmp expect-rm-F actual &&\n \ttest_must_fail git notes show\n '\n@@ -390,17 +393,17 @@ test_expect_success 'remove note with \"git notes remove\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n \n-\t\t${indent}5th\n+\t\t5th\n \n \t\tcommit $parent\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:16:13 2005 -0700\n \n-\t\t${indent}4th\n+\t\t4th\n \n \tEOF\n \tcat expect-multiline >>expect-rm-remove &&\n-\tgit log -4 >actual &&\n+\tlognotes -4 >actual &&\n \ttest_cmp expect-rm-remove actual &&\n \ttest_must_fail git notes show HEAD^\n '\n@@ -570,35 +573,35 @@ test_expect_success 'create other note on a different notes ref (setup)' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n \n-\t\t${indent}6th\n+\t\t6th\n \tEOF\n \tcp expect-not-other expect-other &&\n \tcat >>expect-other <<-EOF\n \n \t\tNotes (other):\n-\t\t${indent}other note\n+\t\tother note\n \tEOF\n '\n \n test_expect_success 'Do not show note on other ref by default' '\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect-not-other actual\n '\n \n test_expect_success 'Do show note when ref is given in GIT_NOTES_REF' '\n-\tGIT_NOTES_REF=\"refs/notes/other\" git log -1 >actual &&\n+\ttest_env GIT_NOTES_REF=\"refs/notes/other\" lognotes -1 >actual &&\n \ttest_cmp expect-other actual\n '\n \n test_expect_success 'Do show note when ref is given in core.notesRef config' '\n \ttest_config core.notesRef \"refs/notes/other\" &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect-other actual\n '\n \n test_expect_success 'Do not show note when core.notesRef is overridden' '\n \ttest_config core.notesRef \"refs/notes/other\" &&\n-\tGIT_NOTES_REF=\"refs/notes/wrong\" git log -1 >actual &&\n+\ttest_env GIT_NOTES_REF=\"refs/notes/wrong\" lognotes -1 >actual &&\n \ttest_cmp expect-not-other actual\n '\n \n@@ -610,36 +613,36 @@ test_expect_success 'Show all notes when notes.displayRef=refs/notes/*' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n \n-\t\t${indent}6th\n+\t\t6th\n \n \t\tNotes:\n-\t\t${indent}order test\n+\t\torder test\n \n \t\tNotes (other):\n-\t\t${indent}other note\n+\t\tother note\n \n \t\tcommit $parent\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n \n-\t\t${indent}5th\n+\t\t5th\n \n \t\tNotes:\n-\t\t${indent}replacement for deleted note\n+\t\treplacement for deleted note\n \tEOF\n \tGIT_NOTES_REF=refs/notes/commits git notes add \\\n \t\t-m\"replacement for deleted note\" HEAD^ &&\n \tGIT_NOTES_REF=refs/notes/commits git notes add -m\"order test\" &&\n \ttest_unconfig core.notesRef &&\n \ttest_config notes.displayRef \"refs/notes/*\" &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect-both actual\n '\n \n test_expect_success 'core.notesRef is implicitly in notes.displayRef' '\n \ttest_config core.notesRef refs/notes/commits &&\n \ttest_config notes.displayRef refs/notes/other &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect-both actual\n '\n \n@@ -647,7 +650,7 @@ test_expect_success 'notes.displayRef can be given more than once' '\n \ttest_unconfig core.notesRef &&\n \ttest_config notes.displayRef refs/notes/commits &&\n \tgit config --add notes.displayRef refs/notes/other &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect-both actual\n '\n \n@@ -658,17 +661,17 @@ test_expect_success 'notes.displayRef respects order' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n \n-\t\t${indent}6th\n+\t\t6th\n \n \t\tNotes (other):\n-\t\t${indent}other note\n+\t\tother note\n \n \t\tNotes:\n-\t\t${indent}order test\n+\t\torder test\n \tEOF\n \ttest_config core.notesRef refs/notes/other &&\n \ttest_config notes.displayRef refs/notes/commits &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect-both-reversed actual\n '\n \n@@ -678,8 +681,8 @@ test_expect_success 'notes.displayRef with no value handled gracefully' '\n '\n \n test_expect_success 'GIT_NOTES_DISPLAY_REF works' '\n-\tGIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n-\t\tgit log -2 >actual &&\n+\ttest_env GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n+\t\tlognotes -2 >actual &&\n \ttest_cmp expect-both actual\n '\n \n@@ -691,21 +694,21 @@ test_expect_success 'GIT_NOTES_DISPLAY_REF overrides config' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n \n-\t\t${indent}6th\n+\t\t6th\n \n \t\tcommit $parent\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n \n-\t\t${indent}5th\n+\t\t5th\n \tEOF\n \ttest_config notes.displayRef \"refs/notes/*\" &&\n-\tGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >actual &&\n+\ttest_env GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= lognotes -2 >actual &&\n \ttest_cmp expect-none actual\n '\n \n test_expect_success '--show-notes=* adds to GIT_NOTES_DISPLAY_REF' '\n-\tGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >actual &&\n+\ttest_env GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= lognotes --show-notes=* -2 >actual &&\n \ttest_cmp expect-both actual\n '\n \n@@ -716,24 +719,24 @@ test_expect_success '--no-standard-notes' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n \n-\t\t${indent}6th\n+\t\t6th\n \n \t\tNotes:\n-\t\t${indent}order test\n+\t\torder test\n \tEOF\n-\tgit log --no-standard-notes --show-notes=commits -1 >actual &&\n+\tlognotes --no-standard-notes --show-notes=commits -1 >actual &&\n \ttest_cmp expect-commits actual\n '\n \n test_expect_success '--standard-notes' '\n \ttest_config notes.displayRef \"refs/notes/*\" &&\n-\tgit log --no-standard-notes --show-notes=commits \\\n+\tlognotes --no-standard-notes --show-notes=commits \\\n \t\t--standard-notes -2 >actual &&\n \ttest_cmp expect-both actual\n '\n \n test_expect_success '--show-notes=ref accumulates' '\n-\tgit log --show-notes=other --show-notes=commits \\\n+\tlognotes --show-notes=other --show-notes=commits \\\n \t\t --no-standard-notes -1 >actual &&\n \ttest_cmp expect-both-reversed actual\n '\n@@ -765,14 +768,14 @@ test_expect_success 'create note from other note with \"git notes add -C\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:19:13 2005 -0700\n \n-\t\t${indent}7th\n+\t\t7th\n \n \t\tNotes:\n-\t\t${indent}order test\n+\t\torder test\n \tEOF\n \tnote=$(git notes list HEAD^) &&\n \tgit notes add -C $note &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD^ >expect &&\n \tgit notes list HEAD >actual &&\n@@ -800,14 +803,14 @@ test_expect_success 'create note from blob with \"git notes add -C\" reuses blob i\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:20:13 2005 -0700\n \n-\t\t${indent}8th\n+\t\t8th\n \n \t\tNotes:\n-\t\t${indent}This is a blob object\n+\t\tThis is a blob object\n \tEOF\n \techo \"This is a blob object\" | git hash-object -w --stdin >blob &&\n \tgit notes add -C $(cat blob) &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD >actual &&\n \ttest_cmp blob actual\n@@ -821,14 +824,14 @@ test_expect_success 'create note from other note with \"git notes add -c\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:21:13 2005 -0700\n \n-\t\t${indent}9th\n+\t\t9th\n \n \t\tNotes:\n-\t\t${indent}yet another note\n+\t\tyet another note\n \tEOF\n \tnote=$(git notes list HEAD^^) &&\n \tMSG=\"yet another note\" git notes add -c $note &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -845,16 +848,16 @@ test_expect_success 'append to note from other note with \"git notes append -C\"'\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:21:13 2005 -0700\n \n-\t\t${indent}9th\n+\t\t9th\n \n \t\tNotes:\n-\t\t${indent}yet another note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tyet another note\n+\n+\t\tyet another note\n \tEOF\n \tnote=$(git notes list HEAD^) &&\n \tgit notes append -C $note HEAD^ &&\n-\tgit log -1 HEAD^ >actual &&\n+\tlognotes -1 HEAD^ >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -865,14 +868,14 @@ test_expect_success 'create note from other note with \"git notes append -c\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:22:13 2005 -0700\n \n-\t\t${indent}10th\n+\t\t10th\n \n \t\tNotes:\n-\t\t${indent}other note\n+\t\tother note\n \tEOF\n \tnote=$(git notes list HEAD^) &&\n \tMSG=\"other note\" git notes append -c $note &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -883,16 +886,16 @@ test_expect_success 'append to note from other note with \"git notes append -c\"'\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:22:13 2005 -0700\n \n-\t\t${indent}10th\n+\t\t10th\n \n \t\tNotes:\n-\t\t${indent}other note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tother note\n+\n+\t\tyet another note\n \tEOF\n \tnote=$(git notes list HEAD) &&\n \tMSG=\"yet another note\" git notes append -c $note &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -903,13 +906,13 @@ test_expect_success 'copy note with \"git notes copy\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:16:13 2005 -0700\n \n-\t\t${indent}4th\n+\t\t4th\n \n \t\tNotes:\n-\t\t${indent}This is a blob object\n+\t\tThis is a blob object\n \tEOF\n \tgit notes copy 8th 4th &&\n-\tgit log 3rd..4th >actual &&\n+\tlognotes 3rd..4th >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list 4th >expect &&\n \tgit notes list 8th >actual &&\n@@ -924,15 +927,15 @@ test_expect_success 'copy note with \"git notes copy\" with default' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n \n-\t\t${indent}11th\n+\t\t11th\n \n \t\tNotes:\n-\t\t${indent}other note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tother note\n+\n+\t\tyet another note\n \tEOF\n \tgit notes copy HEAD^ &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD^ >expect &&\n \tgit notes list HEAD >actual &&\n@@ -946,14 +949,14 @@ test_expect_success 'prevent overwrite with \"git notes copy\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n \n-\t\t${indent}11th\n+\t\t11th\n \n \t\tNotes:\n-\t\t${indent}other note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tother note\n+\n+\t\tyet another note\n \tEOF\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD^ >expect &&\n \tgit notes list HEAD >actual &&\n@@ -967,13 +970,13 @@ test_expect_success 'allow overwrite with \"git notes copy -f\"' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n \n-\t\t${indent}11th\n+\t\t11th\n \n \t\tNotes:\n-\t\t${indent}This is a blob object\n+\t\tThis is a blob object\n \tEOF\n \tgit notes copy -f HEAD~3 HEAD &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD~3 >expect &&\n \tgit notes list HEAD >actual &&\n@@ -987,15 +990,15 @@ test_expect_success 'allow overwrite with \"git notes copy -f\" with default' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n \n-\t\t${indent}11th\n+\t\t11th\n \n \t\tNotes:\n-\t\t${indent}yet another note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tyet another note\n+\n+\t\tyet another note\n \tEOF\n \tgit notes copy -f HEAD~2 &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD~2 >expect &&\n \tgit notes list HEAD >actual &&\n@@ -1016,23 +1019,23 @@ test_expect_success 'git notes copy --stdin' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:25:13 2005 -0700\n \n-\t\t${indent}13th\n+\t\t13th\n \n \t\tNotes:\n-\t\t${indent}yet another note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tyet another note\n+\n+\t\tyet another note\n \n \t\tcommit $parent\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:24:13 2005 -0700\n \n-\t\t${indent}12th\n+\t\t12th\n \n \t\tNotes:\n-\t\t${indent}other note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tother note\n+\n+\t\tyet another note\n \tEOF\n \tfrom=$(git rev-parse HEAD~3) &&\n \tto=$(git rev-parse HEAD^) &&\n@@ -1041,7 +1044,7 @@ test_expect_success 'git notes copy --stdin' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >>copy &&\n \tgit notes copy --stdin <copy &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect actual &&\n \tgit notes list HEAD~2 >expect &&\n \tgit notes list HEAD >actual &&\n@@ -1061,13 +1064,13 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tcommit $parent\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:26:13 2005 -0700\n \n-\t\t${indent}14th\n+\t\t14th\n \tEOF\n \tfrom=$(git rev-parse HEAD~3) &&\n \tto=$(git rev-parse HEAD^) &&\n@@ -1076,7 +1079,7 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >>copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1088,23 +1091,23 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tNotes:\n-\t\t${indent}yet another note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tyet another note\n+\n+\t\tyet another note\n \n \t\tcommit $parent\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:26:13 2005 -0700\n \n-\t\t${indent}14th\n+\t\t14th\n \n \t\tNotes:\n-\t\t${indent}other note\n-\t\t${indent}\n-\t\t${indent}yet another note\n+\t\tother note\n+\n+\t\tyet another note\n \tEOF\n \ttest_config notes.rewriteMode overwrite &&\n \ttest_config notes.rewriteRef \"refs/notes/*\" &&\n@@ -1115,7 +1118,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >>copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1125,7 +1128,7 @@ test_expect_success 'git notes copy --for-rewrite (disabled)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >copy &&\n \tgit notes copy --for-rewrite=bar <copy &&\n-\tgit log -2 >actual &&\n+\tlognotes -2 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1136,10 +1139,10 @@ test_expect_success 'git notes copy --for-rewrite (overwrite)' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tNotes:\n-\t\t${indent}a fresh note\n+\t\ta fresh note\n \tEOF\n \tgit notes add -f -m\"a fresh note\" HEAD^ &&\n \ttest_config notes.rewriteMode overwrite &&\n@@ -1148,7 +1151,7 @@ test_expect_success 'git notes copy --for-rewrite (overwrite)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1159,7 +1162,7 @@ test_expect_success 'git notes copy --for-rewrite (ignore)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1170,12 +1173,12 @@ test_expect_success 'git notes copy --for-rewrite (append)' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tNotes:\n-\t\t${indent}a fresh note\n-\t\t${indent}\n-\t\t${indent}another fresh note\n+\t\ta fresh note\n+\n+\t\tanother fresh note\n \tEOF\n \tgit notes add -f -m\"another fresh note\" HEAD^ &&\n \ttest_config notes.rewriteMode concatenate &&\n@@ -1184,7 +1187,7 @@ test_expect_success 'git notes copy --for-rewrite (append)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1195,16 +1198,16 @@ test_expect_success 'git notes copy --for-rewrite (append two to one)' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tNotes:\n-\t\t${indent}a fresh note\n-\t\t${indent}\n-\t\t${indent}another fresh note\n-\t\t${indent}\n-\t\t${indent}append 1\n-\t\t${indent}\n-\t\t${indent}append 2\n+\t\ta fresh note\n+\n+\t\tanother fresh note\n+\n+\t\tappend 1\n+\n+\t\tappend 2\n \tEOF\n \tgit notes add -f -m\"append 1\" HEAD^ &&\n \tgit notes add -f -m\"append 2\" HEAD^^ &&\n@@ -1217,7 +1220,7 @@ test_expect_success 'git notes copy --for-rewrite (append two to one)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >>copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1229,7 +1232,7 @@ test_expect_success 'git notes copy --for-rewrite (append empty)' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >copy &&\n \tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1240,10 +1243,10 @@ test_expect_success 'GIT_NOTES_REWRITE_MODE works' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tNotes:\n-\t\t${indent}replacement note 1\n+\t\treplacement note 1\n \tEOF\n \ttest_config notes.rewriteMode concatenate &&\n \ttest_config notes.rewriteRef \"refs/notes/*\" &&\n@@ -1252,7 +1255,7 @@ test_expect_success 'GIT_NOTES_REWRITE_MODE works' '\n \tto=$(git rev-parse HEAD) &&\n \techo \"$from\" \"$to\" >copy &&\n \tGIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1263,10 +1266,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF works' '\n \t\tAuthor: A U Thor <author@example.com>\n \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n \n-\t\t${indent}15th\n+\t\t15th\n \n \t\tNotes:\n-\t\t${indent}replacement note 2\n+\t\treplacement note 2\n \tEOF\n \tgit notes add -f -m\"replacement note 2\" HEAD^ &&\n \ttest_config notes.rewriteMode overwrite &&\n@@ -1276,7 +1279,7 @@ test_expect_success 'GIT_NOTES_REWRITE_REF works' '\n \techo \"$from\" \"$to\" >copy &&\n \tGIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \\\n \t\tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1289,7 +1292,7 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' '\n \techo \"$from\" \"$to\" >copy &&\n \tGIT_NOTES_REWRITE_REF=refs/notes/commits \\\n \t\tgit notes copy --for-rewrite=foo <copy &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \tgrep \"replacement note 3\" actual\n '\n \n@@ -1372,13 +1375,13 @@ EOF\n \n test_expect_success 'empty notes are displayed by git log' '\n \ttest_commit 17th &&\n-\tgit log -1 >expect &&\n+\tlognotes -1 >expect &&\n \tcat >>expect <<-EOF &&\n \n \t\tNotes:\n \tEOF\n \tgit notes add -C \"$empty_blob\" --allow-empty &&\n-\tgit log -1 >actual &&\n+\tlognotes -1 >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.33.0.153.gba50c8fa24\n\n"},{"id":"434053","messageId":"20210830072118.91921-3-sunshine@sunshineco.com","threadId":"56400","inReplyTo":"20210830072118.91921-1-sunshine@sunshineco.com","subject":"[PATCH 2/3] t3303/t9301: make `notes` tests less brittle","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T07:21:17Z","receivedAt":"2021-08-30T07:22:55Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"These tests care about whether intended notes-related functionality\noccurred, but they check for the expected result in a brittle way by\nconsulting the default output of `git log` which is intended for human,\nnot machine, consumption. Make the tests more robust by requesting the\ndesired information in a stable machine-consumable format.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n t/t3303-notes-subtrees.sh    | 13 ++++++++-----\n t/t9301-fast-import-notes.sh | 36 +++++++++++++++++++-----------------\n 2 files changed, 27 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh\nindex d47ce00f69..abffa10564 100755\n--- a/t/t3303-notes-subtrees.sh\n+++ b/t/t3303-notes-subtrees.sh\n@@ -171,13 +171,16 @@ INPUT_END\n }\n \n verify_concatenated_notes () {\n-\tgit log | grep \"^    \" > output &&\n+\tgit log --format=\"tformat:%B%N\" >output &&\n \ti=$number_of_commits &&\n \twhile [ $i -gt 0 ]; do\n-\t\techo \"    commit #$i\" &&\n-\t\techo \"    first note for commit #$i\" &&\n-\t\techo \"    \" &&\n-\t\techo \"    second note for commit #$i\" &&\n+\t\tcat <<-EOF &&\n+\t\tcommit #$i\n+\t\tfirst note for commit #$i\n+\n+\t\tsecond note for commit #$i\n+\n+\t\tEOF\n \t\ti=$(($i-1));\n \tdone > expect &&\n \ttest_cmp expect output\ndiff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh\nindex 1ae4d7c0d3..123323b2bb 100755\n--- a/t/t9301-fast-import-notes.sh\n+++ b/t/t9301-fast-import-notes.sh\n@@ -259,29 +259,31 @@ EOF\n \n INPUT_END\n \n-whitespace=\"    \"\n-\n cat >expect <<EXPECT_END\n-    fourth commit\n-    pre-prefix of note for fourth commit\n-$whitespace\n-    prefix of note for fourth commit\n-$whitespace\n-    third note for fourth commit\n-    third commit\n-    prefix of note for third commit\n-$whitespace\n-    third note for third commit\n-    second commit\n-    third note for second commit\n-    first commit\n-    third note for first commit\n+fourth commit\n+pre-prefix of note for fourth commit\n+\n+prefix of note for fourth commit\n+\n+third note for fourth commit\n+\n+third commit\n+prefix of note for third commit\n+\n+third note for third commit\n+\n+second commit\n+third note for second commit\n+\n+first commit\n+third note for first commit\n+\n EXPECT_END\n \n test_expect_success 'add concatenation notes with M command' '\n \n \tgit fast-import <input &&\n-\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n+\tGIT_NOTES_REF=refs/notes/test git log --format=\"tformat:%B%N\" >actual &&\n \ttest_cmp expect actual\n \n '\n-- \n2.33.0.153.gba50c8fa24\n\n"},{"id":"434054","messageId":"20210830072118.91921-4-sunshine@sunshineco.com","threadId":"56400","inReplyTo":"20210830072118.91921-1-sunshine@sunshineco.com","subject":"[PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T07:21:18Z","receivedAt":"2021-08-30T07:22:58Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"Like other Git commands, `git notes` takes care to call `stripspace` on\nthe user-supplied note content, thereby ensuring that it has no trailing\nwhitespace, among other cleanups. However, when notes are inserted into\na patch via `git format-patch --notes`, all lines of the note are\nindented unconditionally, including empty lines, which leaves trailing\nwhitespace on lines which previously were empty, thus negating the\nnormalization done earlier. Fix this shortcoming.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n notes.c                 |  2 +-\n t/t4014-format-patch.sh | 17 +++++++++++++++++\n 2 files changed, 18 insertions(+), 1 deletion(-)\n\ndiff --git a/notes.c b/notes.c\nindex f87dac4068..25e0a59899 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -1295,7 +1295,7 @@ static void format_note(struct notes_tree *t, const struct object_id *object_oid\n \tfor (msg_p = msg; msg_p < msg + msglen; msg_p += linelen + 1) {\n \t\tlinelen = strchrnul(msg_p, '\\n') - msg_p;\n \n-\t\tif (!raw)\n+\t\tif (!raw && linelen)\n \t\t\tstrbuf_addstr(sb, \"    \");\n \t\tstrbuf_add(sb, msg_p, linelen);\n \t\tstrbuf_addch(sb, '\\n');\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 712d4b5ddf..7406e5fe99 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -906,6 +906,23 @@ test_expect_success 'format-patch with multiple notes refs in config' '\n \tgrep \"this is note 2\" out\n '\n \n+test_expect_success 'format-patch --notes does not indent empty lines' '\n+\tgit notes add --file=- HEAD <<-\\EOF &&\n+\tparagraph 1\n+\n+\tparagraph 2\n+\tEOF\n+\ttest_when_finished \"git notes remove HEAD\" &&\n+\tgit format-patch -1 --stdout --notes >out &&\n+\tsed -n \"/^[ \t]*paragraph 1$/,/^[ \t]*paragraph 2$/{s/^[ \t][ \t]*/[indent]/;p;}\" out >actual &&\n+\tcat >expect <<-\\EOF &&\n+\t[indent]paragraph 1\n+\n+\t[indent]paragraph 2\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n echo \"fatal: --name-only does not make sense\" >expect.name-only\n echo \"fatal: --name-status does not make sense\" >expect.name-status\n echo \"fatal: --check does not make sense\" >expect.check\n-- \n2.33.0.153.gba50c8fa24\n\n"},{"id":"434059","messageId":"RFC-cover-v2-0.2-00000000000-20210830T103913Z-avarab@gmail.com","threadId":"56400","inReplyTo":"20210830072118.91921-1-sunshine@sunshineco.com","subject":"[RFC PATCH v2 0/2] suppress trailing whitespace on empty \"notes\" lines","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-30T10:47:12Z","receivedAt":"2021-08-30T10:47:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"This is a review of Eric Sunshin's\n<20210830072118.91921-1-sunshine@sunshineco.com> series.\n\nSide note:\n\n    I'm generally trying to see if just sending a \"proposed vX\" is\n    more productive for everyone than patch feedback effectively\n    describing it in prose. I don't mean for this thing to be picked\n    up as-is by Junio without the consent of the submitter, and don't\n    have any desire to \"pick up\" the series myself.\n\n    My review workflow is just applying the patches locally, fiddling\n    with them, so it seems like the most straightforward and helpful\n    thing to send the result of that local end-state, rather than\n    describing the changes I made in prose, and expect the original\n    submitter to reverse engineer that state if they're interested in\n    trying it out locally themselves.\n\nI really like the end goal of\n<20210830072118.91921-1-sunshine@sunshineco.com> series, but this\nseems like a more straightforward way to get to that goal.\n\nI.e. the original 1/3 and 2/3 starts out by making the tests\nwhitespace-independent. If we just skip that 1/3, and then in 3/3\ntweak the relevant failing tests for the code change we won't even\nneed a new test, all the existing tests previously made\nwhitespace-independent in 1/3 will assert this new behavior.\n\nEric Sunshine (2):\n  t3303/t9301: make `notes` tests less brittle\n  notes: don't indent empty lines\n\n notes.c                      |  2 +-\n t/t3301-notes.sh             | 28 ++++++++++++++--------------\n t/t3303-notes-subtrees.sh    | 13 ++++++++-----\n t/t9301-fast-import-notes.sh | 36 +++++++++++++++++++-----------------\n 4 files changed, 42 insertions(+), 37 deletions(-)\n\nRange-diff against v1:\n1:  d2915b20aee < -:  ----------- t3301: tolerate minor notes-related presentation changes\n2:  478d8b8d104 ! 1:  5a1ddd30859 t3303/t9301: make `notes` tests less brittle\n    @@ Commit message\n         desired information in a stable machine-consumable format.\n     \n         Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n    +    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n     \n      ## t/t3303-notes-subtrees.sh ##\n     @@ t/t3303-notes-subtrees.sh: INPUT_END\n3:  56d05862a67 < -:  ----------- notes: don't indent empty lines\n-:  ----------- > 2:  4b546b83fd7 notes: don't indent empty lines\n-- \n2.33.0.737.g0eefde7d76\n\n"},{"id":"434060","messageId":"RFC-patch-v2-1.2-5a1ddd30859-20210830T103913Z-avarab@gmail.com","threadId":"56400","inReplyTo":"RFC-cover-v2-0.2-00000000000-20210830T103913Z-avarab@gmail.com","subject":"[RFC PATCH v2 1/2] t3303/t9301: make `notes` tests less brittle","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-30T10:47:13Z","receivedAt":"2021-08-30T10:47:26Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Eric Sunshine <sunshine@sunshineco.com>\n\nThese tests care about whether intended notes-related functionality\noccurred, but they check for the expected result in a brittle way by\nconsulting the default output of `git log` which is intended for human,\nnot machine, consumption. Make the tests more robust by requesting the\ndesired information in a stable machine-consumable format.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t3303-notes-subtrees.sh    | 13 ++++++++-----\n t/t9301-fast-import-notes.sh | 36 +++++++++++++++++++-----------------\n 2 files changed, 27 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t3303-notes-subtrees.sh b/t/t3303-notes-subtrees.sh\nindex d47ce00f694..abffa105645 100755\n--- a/t/t3303-notes-subtrees.sh\n+++ b/t/t3303-notes-subtrees.sh\n@@ -171,13 +171,16 @@ INPUT_END\n }\n \n verify_concatenated_notes () {\n-\tgit log | grep \"^    \" > output &&\n+\tgit log --format=\"tformat:%B%N\" >output &&\n \ti=$number_of_commits &&\n \twhile [ $i -gt 0 ]; do\n-\t\techo \"    commit #$i\" &&\n-\t\techo \"    first note for commit #$i\" &&\n-\t\techo \"    \" &&\n-\t\techo \"    second note for commit #$i\" &&\n+\t\tcat <<-EOF &&\n+\t\tcommit #$i\n+\t\tfirst note for commit #$i\n+\n+\t\tsecond note for commit #$i\n+\n+\t\tEOF\n \t\ti=$(($i-1));\n \tdone > expect &&\n \ttest_cmp expect output\ndiff --git a/t/t9301-fast-import-notes.sh b/t/t9301-fast-import-notes.sh\nindex 1ae4d7c0d37..123323b2bbb 100755\n--- a/t/t9301-fast-import-notes.sh\n+++ b/t/t9301-fast-import-notes.sh\n@@ -259,29 +259,31 @@ EOF\n \n INPUT_END\n \n-whitespace=\"    \"\n-\n cat >expect <<EXPECT_END\n-    fourth commit\n-    pre-prefix of note for fourth commit\n-$whitespace\n-    prefix of note for fourth commit\n-$whitespace\n-    third note for fourth commit\n-    third commit\n-    prefix of note for third commit\n-$whitespace\n-    third note for third commit\n-    second commit\n-    third note for second commit\n-    first commit\n-    third note for first commit\n+fourth commit\n+pre-prefix of note for fourth commit\n+\n+prefix of note for fourth commit\n+\n+third note for fourth commit\n+\n+third commit\n+prefix of note for third commit\n+\n+third note for third commit\n+\n+second commit\n+third note for second commit\n+\n+first commit\n+third note for first commit\n+\n EXPECT_END\n \n test_expect_success 'add concatenation notes with M command' '\n \n \tgit fast-import <input &&\n-\tGIT_NOTES_REF=refs/notes/test git log | grep \"^    \" > actual &&\n+\tGIT_NOTES_REF=refs/notes/test git log --format=\"tformat:%B%N\" >actual &&\n \ttest_cmp expect actual\n \n '\n-- \n2.33.0.737.g0eefde7d76\n\n"},{"id":"434061","messageId":"RFC-patch-v2-2.2-4b546b83fd7-20210830T103913Z-avarab@gmail.com","threadId":"56400","inReplyTo":"RFC-cover-v2-0.2-00000000000-20210830T103913Z-avarab@gmail.com","subject":"[RFC PATCH v2 2/2] notes: don't indent empty lines","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-08-30T10:47:14Z","receivedAt":"2021-08-30T10:47:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"From: Eric Sunshine <sunshine@sunshineco.com>\n\nLike other Git commands, `git notes` takes care to call `stripspace` on\nthe user-supplied note content, thereby ensuring that it has no trailing\nwhitespace, among other cleanups. However, when notes are inserted into\na patch via `git format-patch --notes`, all lines of the note are\nindented unconditionally, including empty lines, which leaves trailing\nwhitespace on lines which previously were empty, thus negating the\nnormalization done earlier. Fix this shortcoming.\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n notes.c          |  2 +-\n t/t3301-notes.sh | 28 ++++++++++++++--------------\n 2 files changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/notes.c b/notes.c\nindex f87dac40684..25e0a598996 100644\n--- a/notes.c\n+++ b/notes.c\n@@ -1295,7 +1295,7 @@ static void format_note(struct notes_tree *t, const struct object_id *object_oid\n \tfor (msg_p = msg; msg_p < msg + msglen; msg_p += linelen + 1) {\n \t\tlinelen = strchrnul(msg_p, '\\n') - msg_p;\n \n-\t\tif (!raw)\n+\t\tif (!raw && linelen)\n \t\t\tstrbuf_addstr(sb, \"    \");\n \t\tstrbuf_add(sb, msg_p, linelen);\n \t\tstrbuf_addch(sb, '\\n');\ndiff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\nindex d742be88402..74e5bfbc863 100755\n--- a/t/t3301-notes.sh\n+++ b/t/t3301-notes.sh\n@@ -326,7 +326,7 @@ test_expect_success 'show -m notes' '\n \n \t\tNotes:\n \t\t${indent}spam\n-\t\t${indent}\n+\n \t\t${indent}foo\n \t\t${indent}bar\n \t\t${indent}baz\n@@ -849,7 +849,7 @@ test_expect_success 'append to note from other note with \"git notes append -C\"'\n \n \t\tNotes:\n \t\t${indent}yet another note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \tnote=$(git notes list HEAD^) &&\n@@ -887,7 +887,7 @@ test_expect_success 'append to note from other note with \"git notes append -c\"'\n \n \t\tNotes:\n \t\t${indent}other note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \tnote=$(git notes list HEAD) &&\n@@ -928,7 +928,7 @@ test_expect_success 'copy note with \"git notes copy\" with default' '\n \n \t\tNotes:\n \t\t${indent}other note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \tgit notes copy HEAD^ &&\n@@ -950,7 +950,7 @@ test_expect_success 'prevent overwrite with \"git notes copy\"' '\n \n \t\tNotes:\n \t\t${indent}other note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \tgit log -1 >actual &&\n@@ -991,7 +991,7 @@ test_expect_success 'allow overwrite with \"git notes copy -f\" with default' '\n \n \t\tNotes:\n \t\t${indent}yet another note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \tgit notes copy -f HEAD~2 &&\n@@ -1020,7 +1020,7 @@ test_expect_success 'git notes copy --stdin' '\n \n \t\tNotes:\n \t\t${indent}yet another note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \n \t\tcommit $parent\n@@ -1031,7 +1031,7 @@ test_expect_success 'git notes copy --stdin' '\n \n \t\tNotes:\n \t\t${indent}other note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \tfrom=$(git rev-parse HEAD~3) &&\n@@ -1092,7 +1092,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '\n \n \t\tNotes:\n \t\t${indent}yet another note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \n \t\tcommit $parent\n@@ -1103,7 +1103,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '\n \n \t\tNotes:\n \t\t${indent}other note\n-\t\t${indent}\n+\n \t\t${indent}yet another note\n \tEOF\n \ttest_config notes.rewriteMode overwrite &&\n@@ -1174,7 +1174,7 @@ test_expect_success 'git notes copy --for-rewrite (append)' '\n \n \t\tNotes:\n \t\t${indent}a fresh note\n-\t\t${indent}\n+\n \t\t${indent}another fresh note\n \tEOF\n \tgit notes add -f -m\"another fresh note\" HEAD^ &&\n@@ -1199,11 +1199,11 @@ test_expect_success 'git notes copy --for-rewrite (append two to one)' '\n \n \t\tNotes:\n \t\t${indent}a fresh note\n-\t\t${indent}\n+\n \t\t${indent}another fresh note\n-\t\t${indent}\n+\n \t\t${indent}append 1\n-\t\t${indent}\n+\n \t\t${indent}append 2\n \tEOF\n \tgit notes add -f -m\"append 1\" HEAD^ &&\n-- \n2.33.0.737.g0eefde7d76\n\n"},{"id":"434117","messageId":"CAPig+cRFCtVPoBfMswiO1i6bMw_BUess9q2pto_v4dzHp9X2RA@mail.gmail.com","threadId":"56400","inReplyTo":"RFC-cover-v2-0.2-00000000000-20210830T103913Z-avarab@gmail.com","subject":"Re: [RFC PATCH v2 0/2] suppress trailing whitespace on empty \"notes\" lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T16:45:07Z","receivedAt":"2021-08-30T16:45:22Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 30, 2021 at 6:47 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> Side note:\n>\n>     I'm generally trying to see if just sending a \"proposed vX\" is\n>     more productive for everyone than patch feedback effectively\n>     describing it in prose. I don't mean for this thing to be picked\n>     up as-is by Junio without the consent of the submitter, and don't\n>     have any desire to \"pick up\" the series myself.\n>\n> I really like the end goal of\n> <20210830072118.91921-1-sunshine@sunshineco.com> series, but this\n> seems like a more straightforward way to get to that goal.\n>\n> I.e. the original 1/3 and 2/3 starts out by making the tests\n> whitespace-independent. If we just skip that 1/3, and then in 3/3\n> tweak the relevant failing tests for the code change we won't even\n> need a new test, all the existing tests previously made\n> whitespace-independent in 1/3 will assert this new behavior.\n\nIt probably won't surprise you that this fix to `notes` started out as\na single patch which made the change to `notes.c` and adjusted the\nexisting tests to account for it. In particular, my original changes\nto t3301 were exactly the same changes you made (i.e. merely dropping\nthe empty-line `${indent}` from the few necessary places). I wasn't\nhappy about the additional complexity I had to add to t3303 and t9301\nto continue plucking the notes out of the default git-log output, thus\nsimplified by making those tests less brittle. That, of course,\ndeserved its own patch. I wavered quite a bit about whether to make\nt3301 less brittle too, or to simply apply the minimal changes which I\nhad already made (and which you made independently). Eventually, I\ndecided to split that out as a brittle-fixing patch, as well, to\nbetter future-proof it, but perhaps that's terribly important.\n\nI don't have strong feelings between my v1 and your v2 of this series,\nand would be happy to see Junio pick up either version.\n"},{"id":"434118","messageId":"CAPig+cSZbi78MUzyd_S8J1X7wpH_KWXWLSn5Obott7ZW30q8kg@mail.gmail.com","threadId":"56400","inReplyTo":"CAPig+cRFCtVPoBfMswiO1i6bMw_BUess9q2pto_v4dzHp9X2RA@mail.gmail.com","subject":"Re: [RFC PATCH v2 0/2] suppress trailing whitespace on empty \"notes\" lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T16:50:01Z","receivedAt":"2021-08-30T16:50:15Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 30, 2021 at 12:45 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> It probably won't surprise you that this fix to `notes` started out as\n> a single patch which made the change to `notes.c` and adjusted the\n> existing tests to account for it. In particular, my original changes\n> to t3301 were exactly the same changes you made (i.e. merely dropping\n> the empty-line `${indent}` from the few necessary places). I wasn't\n> happy about the additional complexity I had to add to t3303 and t9301\n> to continue plucking the notes out of the default git-log output, thus\n> simplified by making those tests less brittle. That, of course,\n> deserved its own patch. I wavered quite a bit about whether to make\n> t3301 less brittle too, or to simply apply the minimal changes which I\n> had already made (and which you made independently). Eventually, I\n> decided to split that out as a brittle-fixing patch, as well, to\n> better future-proof it, but perhaps that's terribly important.\n\n...that's NOT terribly important.\n\n(last-second editing mistake strikes again)\n\n> I don't have strong feelings between my v1 and your v2 of this series,\n> and would be happy to see Junio pick up either version.\n"},{"id":"434120","messageId":"xmqqa6ky6ez0.fsf@gitster.g","threadId":"56400","inReplyTo":"RFC-cover-v2-0.2-00000000000-20210830T103913Z-avarab@gmail.com","subject":"Re: [RFC PATCH v2 0/2] suppress trailing whitespace on empty \"notes\" lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-30T17:04:51Z","receivedAt":"2021-08-30T17:04:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:\n\n> This is a review of Eric Sunshin's\n> <20210830072118.91921-1-sunshine@sunshineco.com> series.\n>\n> Side note:\n>\n>     I'm generally trying to see if just sending a \"proposed vX\" is\n>     more productive for everyone than patch feedback effectively\n>     describing it in prose. I don't mean for this thing to be picked\n>     up as-is by Junio without the consent of the submitter, and don't\n>     have any desire to \"pick up\" the series myself.\n\nIt is impossible to read the rationale behind the change between v1\nand \"proposed v2\" in such arrangement, simply because there is no\nplace in the \"proposed v2\" patch to write it down.  Proposed commit\nlog for it should not refer to what \"v1\" said, proposed postimage of\nthe patch should not refer to what \"v1\" did.  Worse, it is harder to\npick good bits from \"proposed v2\" and reject the others.\n\nIt is not a good way to give a feedback on \"v1\".  It does not help\nthe original author.\n\nIt certainly does not help the maintainer, who now has to read two\ncompeting series, sort out the numbering mess.\n\nI do not know if it helps other reviewers, but offhand I do not know\nhow it would, compared to the in-line comments on \"v1\", which is how\nwe usually do reviews.\n\n>     My review workflow is just applying the patches locally, fiddling\n>     with them, so it seems like the most straightforward and helpful\n>     thing to send the result of that local end-state, rather than\n>     describing the changes I made in prose, and expect the original\n>     submitter to reverse engineer that state if they're interested in\n>     trying it out locally themselves.\n\nThe end-state as an additional reference material attached as the\nend note of the review may be helpful, but the in-line comments on\n\"v1\" is a much better way to convey the reason why the change is\nsuggested, I would think.\n"},{"id":"434121","messageId":"xmqq4kb66er7.fsf@gitster.g","threadId":"56400","inReplyTo":"20210830072118.91921-2-sunshine@sunshineco.com","subject":"Re: [PATCH 1/3] t3301: tolerate minor notes-related presentation changes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-30T17:09:32Z","receivedAt":"2021-08-30T17:09:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> These tests care about whether intended notes-related functionality\n> occurred and that `git log` presents the notes in the expected fashion\n> (or, in some cases, that `git log` suppresses the notes). However, the\n> tests hard-code the precise indentation of notes by the default `git\n> log` output, which makes them somewhat brittle since they won't be able\n> to tolerate even minor changes to the presentation. Make the tests a bit\n> more robust by ignoring indentation.\n\nIsn't this losing too much information?  If we lose all, or gain\nrandom number of, leading whitespaces, the test won't notice.\n\n> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>\n> ---\n>  t/t3301-notes.sh | 321 ++++++++++++++++++++++++-----------------------\n>  1 file changed, 162 insertions(+), 159 deletions(-)\n>\n> diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh\n> index d742be8840..955b2670a7 100755\n> --- a/t/t3301-notes.sh\n> +++ b/t/t3301-notes.sh\n> @@ -7,6 +7,11 @@ test_description='Test commit notes'\n>  \n>  . ./test-lib.sh\n>  \n> +lognotes () {\n> +\tgit log \"$@\" >lognotes.out &&\n> +\tsed 's/^[ \t]*//' lognotes.out\n> +}\n> +\n>  write_script fake_editor <<\\EOF\n>  echo \"$MSG\" >\"$1\"\n>  echo \"$MSG\" >&2\n> @@ -14,8 +19,6 @@ EOF\n>  GIT_EDITOR=./fake_editor\n>  export GIT_EDITOR\n>  \n> -indent=\"    \"\n> -\n>  test_expect_success 'cannot annotate non-existing HEAD' '\n>  \ttest_must_fail env MSG=3 git notes add\n>  '\n> @@ -158,14 +161,14 @@ test_expect_success 'show notes' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:14:13 2005 -0700\n>  \n> -\t\t${indent}2nd\n> +\t\t2nd\n>  \n>  \t\tNotes:\n> -\t\t${indent}b1\n> +\t\tb1\n>  \tEOF\n>  \tgit cat-file commit HEAD >commits &&\n>  \t! grep b1 commits &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -178,16 +181,16 @@ test_expect_success 'show multi-line notes' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:15:13 2005 -0700\n>  \n> -\t\t${indent}3rd\n> +\t\t3rd\n>  \n>  \t\tNotes:\n> -\t\t${indent}b3\n> -\t\t${indent}c3c3c3c3\n> -\t\t${indent}d3d3d3\n> +\t\tb3\n> +\t\tc3c3c3c3\n> +\t\td3d3d3\n>  \n>  \tEOF\n>  \tcat expect >>expect-multiline &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect-multiline actual\n>  '\n>  \n> @@ -201,21 +204,21 @@ test_expect_success 'show -F notes' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:16:13 2005 -0700\n>  \n> -\t\t${indent}4th\n> +\t\t4th\n>  \n>  \t\tNotes:\n> -\t\t${indent}xyzzy\n> +\t\txyzzy\n>  \n>  \tEOF\n>  \tcat expect-multiline >>expect-F &&\n> -\tgit log -3 >actual &&\n> +\tlognotes -3 >actual &&\n>  \ttest_cmp expect-F actual\n>  '\n>  \n>  test_expect_success 'Re-adding -F notes without -f fails' '\n>  \techo \"zyxxy\" >note5 &&\n>  \ttest_must_fail git notes add -F note5 &&\n> -\tgit log -3 >actual &&\n> +\tlognotes -3 >actual &&\n>  \ttest_cmp expect-F actual\n>  '\n>  \n> @@ -230,9 +233,9 @@ test_expect_success 'git log --pretty=raw does not show notes' '\n>  \t\tauthor A U Thor <author@example.com> 1112912173 -0700\n>  \t\tcommitter C O Mitter <committer@example.com> 1112912173 -0700\n>  \n> -\t\t${indent}4th\n> +\t\t4th\n>  \tEOF\n> -\tgit log -1 --pretty=raw >actual &&\n> +\tlognotes -1 --pretty=raw >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -240,14 +243,14 @@ test_expect_success 'git log --show-notes' '\n>  \tcat >>expect <<-EOF &&\n>  \n>  \tNotes:\n> -\t${indent}xyzzy\n> +\txyzzy\n>  \tEOF\n> -\tgit log -1 --pretty=raw --show-notes >actual &&\n> +\tlognotes -1 --pretty=raw --show-notes >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n>  test_expect_success 'git log --no-notes' '\n> -\tgit log -1 --no-notes >actual &&\n> +\tlognotes -1 --no-notes >actual &&\n>  \t! grep xyzzy actual\n>  '\n>  \n> @@ -280,25 +283,25 @@ test_expect_success 'setup alternate notes ref' '\n>  '\n>  \n>  test_expect_success 'git log --notes shows default notes' '\n> -\tgit log -1 --notes >actual &&\n> +\tlognotes -1 --notes >actual &&\n>  \tgrep xyzzy actual &&\n>  \t! grep alternate actual\n>  '\n>  \n>  test_expect_success 'git log --notes=X shows only X' '\n> -\tgit log -1 --notes=alternate >actual &&\n> +\tlognotes -1 --notes=alternate >actual &&\n>  \t! grep xyzzy actual &&\n>  \tgrep alternate actual\n>  '\n>  \n>  test_expect_success 'git log --notes --notes=X shows both' '\n> -\tgit log -1 --notes --notes=alternate >actual &&\n> +\tlognotes -1 --notes --notes=alternate >actual &&\n>  \tgrep xyzzy actual &&\n>  \tgrep alternate actual\n>  '\n>  \n>  test_expect_success 'git log --no-notes resets default state' '\n> -\tgit log -1 --notes --notes=alternate \\\n> +\tlognotes -1 --notes --notes=alternate \\\n>  \t\t--no-notes --notes=alternate \\\n>  \t\t>actual &&\n>  \t! grep xyzzy actual &&\n> @@ -306,7 +309,7 @@ test_expect_success 'git log --no-notes resets default state' '\n>  '\n>  \n>  test_expect_success 'git log --no-notes resets ref list' '\n> -\tgit log -1 --notes --notes=alternate \\\n> +\tlognotes -1 --notes --notes=alternate \\\n>  \t\t--no-notes --notes \\\n>  \t\t>actual &&\n>  \tgrep xyzzy actual &&\n> @@ -322,18 +325,18 @@ test_expect_success 'show -m notes' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n>  \n> -\t\t${indent}5th\n> +\t\t5th\n>  \n>  \t\tNotes:\n> -\t\t${indent}spam\n> -\t\t${indent}\n> -\t\t${indent}foo\n> -\t\t${indent}bar\n> -\t\t${indent}baz\n> +\t\tspam\n> +\n> +\t\tfoo\n> +\t\tbar\n> +\t\tbaz\n>  \n>  \tEOF\n>  \tcat expect-F >>expect-m &&\n> -\tgit log -4 >actual &&\n> +\tlognotes -4 >actual &&\n>  \ttest_cmp expect-m actual\n>  '\n>  \n> @@ -345,18 +348,18 @@ test_expect_success 'remove note with add -f -F /dev/null' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n>  \n> -\t\t${indent}5th\n> +\t\t5th\n>  \n>  \tEOF\n>  \tcat expect-F >>expect-rm-F &&\n> -\tgit log -4 >actual &&\n> +\tlognotes -4 >actual &&\n>  \ttest_cmp expect-rm-F actual &&\n>  \ttest_must_fail git notes show\n>  '\n>  \n>  test_expect_success 'do not create empty note with -m \"\"' '\n>  \tgit notes add -m \"\" &&\n> -\tgit log -4 >actual &&\n> +\tlognotes -4 >actual &&\n>  \ttest_cmp expect-rm-F actual &&\n>  \ttest_must_fail git notes show\n>  '\n> @@ -390,17 +393,17 @@ test_expect_success 'remove note with \"git notes remove\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n>  \n> -\t\t${indent}5th\n> +\t\t5th\n>  \n>  \t\tcommit $parent\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:16:13 2005 -0700\n>  \n> -\t\t${indent}4th\n> +\t\t4th\n>  \n>  \tEOF\n>  \tcat expect-multiline >>expect-rm-remove &&\n> -\tgit log -4 >actual &&\n> +\tlognotes -4 >actual &&\n>  \ttest_cmp expect-rm-remove actual &&\n>  \ttest_must_fail git notes show HEAD^\n>  '\n> @@ -570,35 +573,35 @@ test_expect_success 'create other note on a different notes ref (setup)' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n>  \n> -\t\t${indent}6th\n> +\t\t6th\n>  \tEOF\n>  \tcp expect-not-other expect-other &&\n>  \tcat >>expect-other <<-EOF\n>  \n>  \t\tNotes (other):\n> -\t\t${indent}other note\n> +\t\tother note\n>  \tEOF\n>  '\n>  \n>  test_expect_success 'Do not show note on other ref by default' '\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect-not-other actual\n>  '\n>  \n>  test_expect_success 'Do show note when ref is given in GIT_NOTES_REF' '\n> -\tGIT_NOTES_REF=\"refs/notes/other\" git log -1 >actual &&\n> +\ttest_env GIT_NOTES_REF=\"refs/notes/other\" lognotes -1 >actual &&\n>  \ttest_cmp expect-other actual\n>  '\n>  \n>  test_expect_success 'Do show note when ref is given in core.notesRef config' '\n>  \ttest_config core.notesRef \"refs/notes/other\" &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect-other actual\n>  '\n>  \n>  test_expect_success 'Do not show note when core.notesRef is overridden' '\n>  \ttest_config core.notesRef \"refs/notes/other\" &&\n> -\tGIT_NOTES_REF=\"refs/notes/wrong\" git log -1 >actual &&\n> +\ttest_env GIT_NOTES_REF=\"refs/notes/wrong\" lognotes -1 >actual &&\n>  \ttest_cmp expect-not-other actual\n>  '\n>  \n> @@ -610,36 +613,36 @@ test_expect_success 'Show all notes when notes.displayRef=refs/notes/*' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n>  \n> -\t\t${indent}6th\n> +\t\t6th\n>  \n>  \t\tNotes:\n> -\t\t${indent}order test\n> +\t\torder test\n>  \n>  \t\tNotes (other):\n> -\t\t${indent}other note\n> +\t\tother note\n>  \n>  \t\tcommit $parent\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n>  \n> -\t\t${indent}5th\n> +\t\t5th\n>  \n>  \t\tNotes:\n> -\t\t${indent}replacement for deleted note\n> +\t\treplacement for deleted note\n>  \tEOF\n>  \tGIT_NOTES_REF=refs/notes/commits git notes add \\\n>  \t\t-m\"replacement for deleted note\" HEAD^ &&\n>  \tGIT_NOTES_REF=refs/notes/commits git notes add -m\"order test\" &&\n>  \ttest_unconfig core.notesRef &&\n>  \ttest_config notes.displayRef \"refs/notes/*\" &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect-both actual\n>  '\n>  \n>  test_expect_success 'core.notesRef is implicitly in notes.displayRef' '\n>  \ttest_config core.notesRef refs/notes/commits &&\n>  \ttest_config notes.displayRef refs/notes/other &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect-both actual\n>  '\n>  \n> @@ -647,7 +650,7 @@ test_expect_success 'notes.displayRef can be given more than once' '\n>  \ttest_unconfig core.notesRef &&\n>  \ttest_config notes.displayRef refs/notes/commits &&\n>  \tgit config --add notes.displayRef refs/notes/other &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect-both actual\n>  '\n>  \n> @@ -658,17 +661,17 @@ test_expect_success 'notes.displayRef respects order' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n>  \n> -\t\t${indent}6th\n> +\t\t6th\n>  \n>  \t\tNotes (other):\n> -\t\t${indent}other note\n> +\t\tother note\n>  \n>  \t\tNotes:\n> -\t\t${indent}order test\n> +\t\torder test\n>  \tEOF\n>  \ttest_config core.notesRef refs/notes/other &&\n>  \ttest_config notes.displayRef refs/notes/commits &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect-both-reversed actual\n>  '\n>  \n> @@ -678,8 +681,8 @@ test_expect_success 'notes.displayRef with no value handled gracefully' '\n>  '\n>  \n>  test_expect_success 'GIT_NOTES_DISPLAY_REF works' '\n> -\tGIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n> -\t\tgit log -2 >actual &&\n> +\ttest_env GIT_NOTES_DISPLAY_REF=refs/notes/commits:refs/notes/other \\\n> +\t\tlognotes -2 >actual &&\n>  \ttest_cmp expect-both actual\n>  '\n>  \n> @@ -691,21 +694,21 @@ test_expect_success 'GIT_NOTES_DISPLAY_REF overrides config' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n>  \n> -\t\t${indent}6th\n> +\t\t6th\n>  \n>  \t\tcommit $parent\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:17:13 2005 -0700\n>  \n> -\t\t${indent}5th\n> +\t\t5th\n>  \tEOF\n>  \ttest_config notes.displayRef \"refs/notes/*\" &&\n> -\tGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log -2 >actual &&\n> +\ttest_env GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= lognotes -2 >actual &&\n>  \ttest_cmp expect-none actual\n>  '\n>  \n>  test_expect_success '--show-notes=* adds to GIT_NOTES_DISPLAY_REF' '\n> -\tGIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= git log --show-notes=* -2 >actual &&\n> +\ttest_env GIT_NOTES_REF= GIT_NOTES_DISPLAY_REF= lognotes --show-notes=* -2 >actual &&\n>  \ttest_cmp expect-both actual\n>  '\n>  \n> @@ -716,24 +719,24 @@ test_expect_success '--no-standard-notes' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:18:13 2005 -0700\n>  \n> -\t\t${indent}6th\n> +\t\t6th\n>  \n>  \t\tNotes:\n> -\t\t${indent}order test\n> +\t\torder test\n>  \tEOF\n> -\tgit log --no-standard-notes --show-notes=commits -1 >actual &&\n> +\tlognotes --no-standard-notes --show-notes=commits -1 >actual &&\n>  \ttest_cmp expect-commits actual\n>  '\n>  \n>  test_expect_success '--standard-notes' '\n>  \ttest_config notes.displayRef \"refs/notes/*\" &&\n> -\tgit log --no-standard-notes --show-notes=commits \\\n> +\tlognotes --no-standard-notes --show-notes=commits \\\n>  \t\t--standard-notes -2 >actual &&\n>  \ttest_cmp expect-both actual\n>  '\n>  \n>  test_expect_success '--show-notes=ref accumulates' '\n> -\tgit log --show-notes=other --show-notes=commits \\\n> +\tlognotes --show-notes=other --show-notes=commits \\\n>  \t\t --no-standard-notes -1 >actual &&\n>  \ttest_cmp expect-both-reversed actual\n>  '\n> @@ -765,14 +768,14 @@ test_expect_success 'create note from other note with \"git notes add -C\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:19:13 2005 -0700\n>  \n> -\t\t${indent}7th\n> +\t\t7th\n>  \n>  \t\tNotes:\n> -\t\t${indent}order test\n> +\t\torder test\n>  \tEOF\n>  \tnote=$(git notes list HEAD^) &&\n>  \tgit notes add -C $note &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD^ >expect &&\n>  \tgit notes list HEAD >actual &&\n> @@ -800,14 +803,14 @@ test_expect_success 'create note from blob with \"git notes add -C\" reuses blob i\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:20:13 2005 -0700\n>  \n> -\t\t${indent}8th\n> +\t\t8th\n>  \n>  \t\tNotes:\n> -\t\t${indent}This is a blob object\n> +\t\tThis is a blob object\n>  \tEOF\n>  \techo \"This is a blob object\" | git hash-object -w --stdin >blob &&\n>  \tgit notes add -C $(cat blob) &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD >actual &&\n>  \ttest_cmp blob actual\n> @@ -821,14 +824,14 @@ test_expect_success 'create note from other note with \"git notes add -c\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:21:13 2005 -0700\n>  \n> -\t\t${indent}9th\n> +\t\t9th\n>  \n>  \t\tNotes:\n> -\t\t${indent}yet another note\n> +\t\tyet another note\n>  \tEOF\n>  \tnote=$(git notes list HEAD^^) &&\n>  \tMSG=\"yet another note\" git notes add -c $note &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -845,16 +848,16 @@ test_expect_success 'append to note from other note with \"git notes append -C\"'\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:21:13 2005 -0700\n>  \n> -\t\t${indent}9th\n> +\t\t9th\n>  \n>  \t\tNotes:\n> -\t\t${indent}yet another note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tyet another note\n> +\n> +\t\tyet another note\n>  \tEOF\n>  \tnote=$(git notes list HEAD^) &&\n>  \tgit notes append -C $note HEAD^ &&\n> -\tgit log -1 HEAD^ >actual &&\n> +\tlognotes -1 HEAD^ >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -865,14 +868,14 @@ test_expect_success 'create note from other note with \"git notes append -c\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:22:13 2005 -0700\n>  \n> -\t\t${indent}10th\n> +\t\t10th\n>  \n>  \t\tNotes:\n> -\t\t${indent}other note\n> +\t\tother note\n>  \tEOF\n>  \tnote=$(git notes list HEAD^) &&\n>  \tMSG=\"other note\" git notes append -c $note &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -883,16 +886,16 @@ test_expect_success 'append to note from other note with \"git notes append -c\"'\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:22:13 2005 -0700\n>  \n> -\t\t${indent}10th\n> +\t\t10th\n>  \n>  \t\tNotes:\n> -\t\t${indent}other note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tother note\n> +\n> +\t\tyet another note\n>  \tEOF\n>  \tnote=$(git notes list HEAD) &&\n>  \tMSG=\"yet another note\" git notes append -c $note &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -903,13 +906,13 @@ test_expect_success 'copy note with \"git notes copy\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:16:13 2005 -0700\n>  \n> -\t\t${indent}4th\n> +\t\t4th\n>  \n>  \t\tNotes:\n> -\t\t${indent}This is a blob object\n> +\t\tThis is a blob object\n>  \tEOF\n>  \tgit notes copy 8th 4th &&\n> -\tgit log 3rd..4th >actual &&\n> +\tlognotes 3rd..4th >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list 4th >expect &&\n>  \tgit notes list 8th >actual &&\n> @@ -924,15 +927,15 @@ test_expect_success 'copy note with \"git notes copy\" with default' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n>  \n> -\t\t${indent}11th\n> +\t\t11th\n>  \n>  \t\tNotes:\n> -\t\t${indent}other note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tother note\n> +\n> +\t\tyet another note\n>  \tEOF\n>  \tgit notes copy HEAD^ &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD^ >expect &&\n>  \tgit notes list HEAD >actual &&\n> @@ -946,14 +949,14 @@ test_expect_success 'prevent overwrite with \"git notes copy\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n>  \n> -\t\t${indent}11th\n> +\t\t11th\n>  \n>  \t\tNotes:\n> -\t\t${indent}other note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tother note\n> +\n> +\t\tyet another note\n>  \tEOF\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD^ >expect &&\n>  \tgit notes list HEAD >actual &&\n> @@ -967,13 +970,13 @@ test_expect_success 'allow overwrite with \"git notes copy -f\"' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n>  \n> -\t\t${indent}11th\n> +\t\t11th\n>  \n>  \t\tNotes:\n> -\t\t${indent}This is a blob object\n> +\t\tThis is a blob object\n>  \tEOF\n>  \tgit notes copy -f HEAD~3 HEAD &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD~3 >expect &&\n>  \tgit notes list HEAD >actual &&\n> @@ -987,15 +990,15 @@ test_expect_success 'allow overwrite with \"git notes copy -f\" with default' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:23:13 2005 -0700\n>  \n> -\t\t${indent}11th\n> +\t\t11th\n>  \n>  \t\tNotes:\n> -\t\t${indent}yet another note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tyet another note\n> +\n> +\t\tyet another note\n>  \tEOF\n>  \tgit notes copy -f HEAD~2 &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD~2 >expect &&\n>  \tgit notes list HEAD >actual &&\n> @@ -1016,23 +1019,23 @@ test_expect_success 'git notes copy --stdin' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:25:13 2005 -0700\n>  \n> -\t\t${indent}13th\n> +\t\t13th\n>  \n>  \t\tNotes:\n> -\t\t${indent}yet another note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tyet another note\n> +\n> +\t\tyet another note\n>  \n>  \t\tcommit $parent\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:24:13 2005 -0700\n>  \n> -\t\t${indent}12th\n> +\t\t12th\n>  \n>  \t\tNotes:\n> -\t\t${indent}other note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tother note\n> +\n> +\t\tyet another note\n>  \tEOF\n>  \tfrom=$(git rev-parse HEAD~3) &&\n>  \tto=$(git rev-parse HEAD^) &&\n> @@ -1041,7 +1044,7 @@ test_expect_success 'git notes copy --stdin' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >>copy &&\n>  \tgit notes copy --stdin <copy &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect actual &&\n>  \tgit notes list HEAD~2 >expect &&\n>  \tgit notes list HEAD >actual &&\n> @@ -1061,13 +1064,13 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tcommit $parent\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:26:13 2005 -0700\n>  \n> -\t\t${indent}14th\n> +\t\t14th\n>  \tEOF\n>  \tfrom=$(git rev-parse HEAD~3) &&\n>  \tto=$(git rev-parse HEAD^) &&\n> @@ -1076,7 +1079,7 @@ test_expect_success 'git notes copy --for-rewrite (unconfigured)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >>copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1088,23 +1091,23 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tNotes:\n> -\t\t${indent}yet another note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tyet another note\n> +\n> +\t\tyet another note\n>  \n>  \t\tcommit $parent\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:26:13 2005 -0700\n>  \n> -\t\t${indent}14th\n> +\t\t14th\n>  \n>  \t\tNotes:\n> -\t\t${indent}other note\n> -\t\t${indent}\n> -\t\t${indent}yet another note\n> +\t\tother note\n> +\n> +\t\tyet another note\n>  \tEOF\n>  \ttest_config notes.rewriteMode overwrite &&\n>  \ttest_config notes.rewriteRef \"refs/notes/*\" &&\n> @@ -1115,7 +1118,7 @@ test_expect_success 'git notes copy --for-rewrite (enabled)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >>copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1125,7 +1128,7 @@ test_expect_success 'git notes copy --for-rewrite (disabled)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tgit notes copy --for-rewrite=bar <copy &&\n> -\tgit log -2 >actual &&\n> +\tlognotes -2 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1136,10 +1139,10 @@ test_expect_success 'git notes copy --for-rewrite (overwrite)' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tNotes:\n> -\t\t${indent}a fresh note\n> +\t\ta fresh note\n>  \tEOF\n>  \tgit notes add -f -m\"a fresh note\" HEAD^ &&\n>  \ttest_config notes.rewriteMode overwrite &&\n> @@ -1148,7 +1151,7 @@ test_expect_success 'git notes copy --for-rewrite (overwrite)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1159,7 +1162,7 @@ test_expect_success 'git notes copy --for-rewrite (ignore)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1170,12 +1173,12 @@ test_expect_success 'git notes copy --for-rewrite (append)' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tNotes:\n> -\t\t${indent}a fresh note\n> -\t\t${indent}\n> -\t\t${indent}another fresh note\n> +\t\ta fresh note\n> +\n> +\t\tanother fresh note\n>  \tEOF\n>  \tgit notes add -f -m\"another fresh note\" HEAD^ &&\n>  \ttest_config notes.rewriteMode concatenate &&\n> @@ -1184,7 +1187,7 @@ test_expect_success 'git notes copy --for-rewrite (append)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1195,16 +1198,16 @@ test_expect_success 'git notes copy --for-rewrite (append two to one)' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tNotes:\n> -\t\t${indent}a fresh note\n> -\t\t${indent}\n> -\t\t${indent}another fresh note\n> -\t\t${indent}\n> -\t\t${indent}append 1\n> -\t\t${indent}\n> -\t\t${indent}append 2\n> +\t\ta fresh note\n> +\n> +\t\tanother fresh note\n> +\n> +\t\tappend 1\n> +\n> +\t\tappend 2\n>  \tEOF\n>  \tgit notes add -f -m\"append 1\" HEAD^ &&\n>  \tgit notes add -f -m\"append 2\" HEAD^^ &&\n> @@ -1217,7 +1220,7 @@ test_expect_success 'git notes copy --for-rewrite (append two to one)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >>copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1229,7 +1232,7 @@ test_expect_success 'git notes copy --for-rewrite (append empty)' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1240,10 +1243,10 @@ test_expect_success 'GIT_NOTES_REWRITE_MODE works' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tNotes:\n> -\t\t${indent}replacement note 1\n> +\t\treplacement note 1\n>  \tEOF\n>  \ttest_config notes.rewriteMode concatenate &&\n>  \ttest_config notes.rewriteRef \"refs/notes/*\" &&\n> @@ -1252,7 +1255,7 @@ test_expect_success 'GIT_NOTES_REWRITE_MODE works' '\n>  \tto=$(git rev-parse HEAD) &&\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tGIT_NOTES_REWRITE_MODE=overwrite git notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1263,10 +1266,10 @@ test_expect_success 'GIT_NOTES_REWRITE_REF works' '\n>  \t\tAuthor: A U Thor <author@example.com>\n>  \t\tDate:   Thu Apr 7 15:27:13 2005 -0700\n>  \n> -\t\t${indent}15th\n> +\t\t15th\n>  \n>  \t\tNotes:\n> -\t\t${indent}replacement note 2\n> +\t\treplacement note 2\n>  \tEOF\n>  \tgit notes add -f -m\"replacement note 2\" HEAD^ &&\n>  \ttest_config notes.rewriteMode overwrite &&\n> @@ -1276,7 +1279,7 @@ test_expect_success 'GIT_NOTES_REWRITE_REF works' '\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tGIT_NOTES_REWRITE_REF=refs/notes/commits:refs/notes/other \\\n>  \t\tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -1289,7 +1292,7 @@ test_expect_success 'GIT_NOTES_REWRITE_REF overrides config' '\n>  \techo \"$from\" \"$to\" >copy &&\n>  \tGIT_NOTES_REWRITE_REF=refs/notes/commits \\\n>  \t\tgit notes copy --for-rewrite=foo <copy &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \tgrep \"replacement note 3\" actual\n>  '\n>  \n> @@ -1372,13 +1375,13 @@ EOF\n>  \n>  test_expect_success 'empty notes are displayed by git log' '\n>  \ttest_commit 17th &&\n> -\tgit log -1 >expect &&\n> +\tlognotes -1 >expect &&\n>  \tcat >>expect <<-EOF &&\n>  \n>  \t\tNotes:\n>  \tEOF\n>  \tgit notes add -C \"$empty_blob\" --allow-empty &&\n> -\tgit log -1 >actual &&\n> +\tlognotes -1 >actual &&\n>  \ttest_cmp expect actual\n>  '\n"},{"id":"434122","messageId":"xmqqwno2505w.fsf@gitster.g","threadId":"56400","inReplyTo":"20210830072118.91921-4-sunshine@sunshineco.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-30T17:10:03Z","receivedAt":"2021-08-30T17:10:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> Like other Git commands, `git notes` takes care to call `stripspace` on\n> the user-supplied note content, thereby ensuring that it has no trailing\n> whitespace, among other cleanups. However, when notes are inserted into\n> a patch via `git format-patch --notes`, all lines of the note are\n> indented unconditionally, including empty lines, which leaves trailing\n> whitespace on lines which previously were empty, thus negating the\n> normalization done earlier. Fix this shortcoming.\n\nPlaying the devil's advocate, it can be argued that using the same\nleading whitespace on a paragraph break line is actually a good\nthing.  Leaving them in would give the consumer an easy way to see\nwhich part was inserted from a note.\n"},{"id":"434130","messageId":"CAPig+cQ6FA0rUnkkTDRUD5vAD3cDXW9vtR1oX0pUJK5eJB9CHg@mail.gmail.com","threadId":"56400","inReplyTo":"xmqqwno2505w.fsf@gitster.g","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T17:41:03Z","receivedAt":"2021-08-30T17:41:18Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 30, 2021 at 1:10 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > Like other Git commands, `git notes` takes care to call `stripspace` on\n> > the user-supplied note content, thereby ensuring that it has no trailing\n> > whitespace, among other cleanups. However, when notes are inserted into\n> > a patch via `git format-patch --notes`, all lines of the note are\n> > indented unconditionally, including empty lines, which leaves trailing\n> > whitespace on lines which previously were empty, thus negating the\n> > normalization done earlier. Fix this shortcoming.\n>\n> Playing the devil's advocate, it can be argued that using the same\n> leading whitespace on a paragraph break line is actually a good\n> thing.  Leaving them in would give the consumer an easy way to see\n> which part was inserted from a note.\n\nThe, um, angel's response: `git format-patch --notes` is a convenience\nfor the _submitter_ of a series. It is difficult to imagine a\nscenario[1] in which the _consumer_ of a series would care or need to\nknow whether patch commentary was written by hand, inserted\nmechanically (by `--notes`), or inserted mechanically and then\nhand-edited.\n\nThe trailing whitespace is unusual within the Git sphere, as well as\nunsightly if you happen to have your editor configured to highlight\ntrailing whitespace, and just \"feels\" sloppy.\n\n[1]: I suppose mechanical extraction of notes may be one such\nscenario, allowing for simple-minded (not necessarily robust)\nextraction mechanics; i.e. start extracting after the /^Notes:$/ line\nand stop at the first line not indented with four blanks.\n"},{"id":"434134","messageId":"xmqqeeaa4y0v.fsf@gitster.g","threadId":"56400","inReplyTo":"CAPig+cQ6FA0rUnkkTDRUD5vAD3cDXW9vtR1oX0pUJK5eJB9CHg@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-08-30T17:56:16Z","receivedAt":"2021-08-30T17:56:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> The trailing whitespace is unusual within the Git sphere, as well as\n> unsightly if you happen to have your editor configured to highlight\n> trailing whitespace, and just \"feels\" sloppy.\n\nBut we are discussing this in the context of format-patch output,\nwhere patches that change lines near a blank line will have a line\nwith a single SP on it in common context ;-)\n\nI do not feel very strongly either way, though.\n\n> [1]: I suppose mechanical extraction of notes may be one such\n> scenario, allowing for simple-minded (not necessarily robust)\n> extraction mechanics; i.e. start extracting after the /^Notes:$/ line\n> and stop at the first line not indented with four blanks.\n\nYup, that was what I had in mind.\n"},{"id":"434135","messageId":"CAPig+cQdXp0c+JYthvy+bbr6vLR7nq4pQY3w+CADUtzr+Ang4A@mail.gmail.com","threadId":"56400","inReplyTo":"xmqqeeaa4y0v.fsf@gitster.g","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T18:04:07Z","receivedAt":"2021-08-30T18:04:21Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 30, 2021 at 1:56 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > [1]: I suppose mechanical extraction of notes may be one such\n> > scenario, allowing for simple-minded (not necessarily robust)\n> > extraction mechanics; i.e. start extracting after the /^Notes:$/ line\n> > and stop at the first line not indented with four blanks.\n>\n> Yup, that was what I had in mind.\n\nIn the general case, such an extraction mechanism would be far too\nfragile since there are no guarantees that the commentary in the\n\"Notes:\" section hasn't been hand-edited after patch-generation.\nHowever, it's certainly possible that such a simple-minded extraction\ntechnique might be applicable in some well-controlled development\npipeline somewhere.\n\nIf we are worried about that, then we can drop this patch series.\n"},{"id":"434140","messageId":"CAPig+cRqMjaujwfwzrqNyxaMN9y4r7RP2W6kOcP-kKcnvrjYxQ@mail.gmail.com","threadId":"56400","inReplyTo":"xmqq4kb66er7.fsf@gitster.g","subject":"Re: [PATCH 1/3] t3301: tolerate minor notes-related presentation changes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-08-30T18:16:09Z","receivedAt":"2021-08-30T18:16:34Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 30, 2021 at 1:09 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > These tests care about whether intended notes-related functionality\n> > occurred and that `git log` presents the notes in the expected fashion\n> > (or, in some cases, that `git log` suppresses the notes). However, the\n> > tests hard-code the precise indentation of notes by the default `git\n> > log` output, which makes them somewhat brittle since they won't be able\n> > to tolerate even minor changes to the presentation. Make the tests a bit\n> > more robust by ignoring indentation.\n>\n> Isn't this losing too much information?  If we lose all, or gain\n> random number of, leading whitespaces, the test won't notice.\n\nThat was the idea. The precise amount of indentation -- whether four\nspaces or one TAB or whatever -- seems pretty much immaterial in the\nwide view [1], and it is not inconceivable that the exact amount of\nindentation might change in the future, thus this future-proofs the\ntests against minor indentation changes.\n\nHowever, as mentioned in my response to Ævar, I wavered quite a bit on\nwhether or not to make this change since, although the justification\nof \"future-proofing\" the tests isn't exactly hand-wavy, we don't need\nthe change either. It may be a case of YAGNI. So, as I also mentioned\nin that response, I don't mind at all dropping this patch and going\nwith Ævar's version.\n\n[1]: mechanical extraction aside...\n"},{"id":"435366","messageId":"CAPig+cTFbnrPPSZbzihJ9gdGV2c4poXWyNjhK3mnr5_uRwpxbg@mail.gmail.com","threadId":"56400","inReplyTo":"CAPig+cQdXp0c+JYthvy+bbr6vLR7nq4pQY3w+CADUtzr+Ang4A@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-09-10T05:18:20Z","receivedAt":"2021-09-10T05:18:35Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 30, 2021 at 2:04 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> In the general case, such an extraction mechanism would be far too\n> fragile since there are no guarantees that the commentary in the\n> \"Notes:\" section hasn't been hand-edited after patch-generation.\n> However, it's certainly possible that such a simple-minded extraction\n> technique might be applicable in some well-controlled development\n> pipeline somewhere.\n>\n> If we are worried about that, then we can drop this patch series.\n\nHave we made a decision about whether this patch series -- which\navoids indenting blank notes lines -- is desirable? Or are we worried\nabout backward-compatibility? If we think there is value in this\nseries, then I can re-roll with Ævar suggestions. If not, perhaps I\ncan re-submit just patch [1/3] which makes a few tests less brittle.\nOr, since those brittle tests aren't necessarily hurting anything, we\ncan just let this series die.\n\nThoughts?\n"},{"id":"435367","messageId":"CAPig+cR5Gm0Jq24EbsuaU2NV4uaT61CcYzE_yyR81OrOw1h3vQ@mail.gmail.com","threadId":"56400","inReplyTo":"CAPig+cTFbnrPPSZbzihJ9gdGV2c4poXWyNjhK3mnr5_uRwpxbg@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-09-10T05:21:26Z","receivedAt":"2021-09-10T05:21:40Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Sep 10, 2021 at 1:18 AM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> Have we made a decision about whether this patch series -- which\n> avoids indenting blank notes lines -- is desirable? Or are we worried\n> about backward-compatibility? If we think there is value in this\n> series, then I can re-roll with Ævar suggestions. If not, perhaps I\n> can re-submit just patch [1/3] which makes a few tests less brittle.\n> Or, since those brittle tests aren't necessarily hurting anything, we\n> can just let this series die.\n\nI meant [2/3], not [1/3], as a possibility for a standalone\nre-submission. That's the patch in which a few tests in t3303 and\nt9301 which care only whether notes are present (or not) are made less\nbrittle by removing dependence upon the default output format of\ngit-log.\n"},{"id":"435458","messageId":"xmqqwnnos2jz.fsf@gitster.g","threadId":"56400","inReplyTo":"CAPig+cTFbnrPPSZbzihJ9gdGV2c4poXWyNjhK3mnr5_uRwpxbg@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-09-10T18:33:52Z","receivedAt":"2021-09-10T18:33:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> Have we made a decision about whether this patch series -- which\n> avoids indenting blank notes lines -- is desirable? Or are we worried\n> about backward-compatibility?\n\nI do not know about \"have we made\" part of the question, but an\ninput from me to come to an answer to the question is that, while I\ncan see why it may be desirable in some cases, I do not view it as\ncompelling enough to risk any unforeseen breakage to other peoples'\nworkflow.  My opinion is based on an assumption that it is desirable\nbecause it would squelch \"here is a trailing whitespace\" noise in an\neditor and/or a pager that is appropriately configured and allow the\nuser to spot whitespace breakages in the payload more easily and for\nno other reason.  If there are other reasons that make this change\ndesirable, they might influence my opinion.\n"},{"id":"435480","messageId":"CAPig+cQdAuLkZ0pDK6XOfm_WXCJAOm8Tr19oK14n-Tf7DcfW=w@mail.gmail.com","threadId":"56400","inReplyTo":"xmqqwnnos2jz.fsf@gitster.g","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-09-10T20:31:21Z","receivedAt":"2021-09-10T20:31:36Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Sep 10, 2021 at 2:33 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > Have we made a decision about whether this patch series -- which\n> > avoids indenting blank notes lines -- is desirable? Or are we worried\n> > about backward-compatibility?\n>\n> I do not know about \"have we made\" part of the question, but an\n> input from me to come to an answer to the question is that, while I\n> can see why it may be desirable in some cases, I do not view it as\n> compelling enough to risk any unforeseen breakage to other peoples'\n> workflow.  My opinion is based on an assumption that it is desirable\n> because it would squelch \"here is a trailing whitespace\" noise in an\n> editor and/or a pager that is appropriately configured and allow the\n> user to spot whitespace breakages in the payload more easily and for\n> no other reason.  If there are other reasons that make this change\n> desirable, they might influence my opinion.\n\nThank you for the response. I didn't have any other reason beyond\nsquelching \"here is trailing whitespace\" noise when submitting the\nseries. Thus, I can't provide any other reasons to promote the change\nas desirable.\n"},{"id":"435500","messageId":"878s03c1of.fsf@evledraar.gmail.com","threadId":"56400","inReplyTo":"CAPig+cQdAuLkZ0pDK6XOfm_WXCJAOm8Tr19oK14n-Tf7DcfW=w@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-09-11T01:53:38Z","receivedAt":"2021-09-11T01:59:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Sep 10 2021, Eric Sunshine wrote:\n\n> On Fri, Sep 10, 2021 at 2:33 PM Junio C Hamano <gitster@pobox.com> wrote:\n>> Eric Sunshine <sunshine@sunshineco.com> writes:\n>> > Have we made a decision about whether this patch series -- which\n>> > avoids indenting blank notes lines -- is desirable? Or are we worried\n>> > about backward-compatibility?\n>>\n>> I do not know about \"have we made\" part of the question, but an\n>> input from me to come to an answer to the question is that, while I\n>> can see why it may be desirable in some cases, I do not view it as\n>> compelling enough to risk any unforeseen breakage to other peoples'\n>> workflow.  My opinion is based on an assumption that it is desirable\n>> because it would squelch \"here is a trailing whitespace\" noise in an\n>> editor and/or a pager that is appropriately configured and allow the\n>> user to spot whitespace breakages in the payload more easily and for\n>> no other reason.  If there are other reasons that make this change\n>> desirable, they might influence my opinion.\n>\n> Thank you for the response. I didn't have any other reason beyond\n> squelching \"here is trailing whitespace\" noise when submitting the\n> series. Thus, I can't provide any other reasons to promote the change\n> as desirable.\n\nThis change per-se seems nice, but even having reviewed it to the point\nof rewriting parts of it, I didn't really look into what the whole\nworkflow you were trying to address is.\n\nSo e.g. just to pick a random commit of your for show:\n    \n    $ git show c990a4c11dd | sed 's/$/Z/'\n    commit c990a4c11ddZ\n    Author: Eric Sunshine <sunshine@sunshineco.com>Z\n    Date:   Mon Jul 6 13:30:45 2015 -0400Z\n    Z\n        checkout: fix bug with --to and relative HEADZ\n        Z\n        Given \"git checkout --to <path> HEAD~1\", the new worktree's HEAD shouldZ\n        begin life at the current branch's HEAD~1, however, it actually ends upZ\n        at HEAD~2. This happens because:Z\n        Z\n            1. git-checkout resolves HEAD~1Z\n        Z\n    [...]\n\nHere we end up also adding the whitespace indenting to the empty lines,\nwhereas if we were trying to feed this to an editor we'd place those\nlater Z's at the start of our line.\n\nAre notes different? Or are they just similarly indented? For commits we\ndon't insert that leading whitespace in the commit object, do notes get\nthat part wrong too?\n\nIt might be showing, but I've only used notes a few times, my main use\nof them is Junio's amlog.\n\nSo even for someone experienced in git, I think some show & tell of\nstep-by-step showing in the commit message how we end up with X before,\nand have Y with this change would help a lot.\n"},{"id":"435527","messageId":"CAPig+cQ+qVNBJqHmQgk6D1fbYHHJpAxhfwyBOgevi9Hvs6JYkw@mail.gmail.com","threadId":"56400","inReplyTo":"878s03c1of.fsf@evledraar.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-09-11T09:15:43Z","receivedAt":"2021-09-11T09:15:57Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Sep 10, 2021 at 9:59 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> >> Eric Sunshine <sunshine@sunshineco.com> writes:\n> >> > Have we made a decision about whether this patch series -- which\n> >> > avoids indenting blank notes lines -- is desirable? Or are we worried\n> >> > about backward-compatibility?\n>\n> This change per-se seems nice, but even having reviewed it to the point\n> of rewriting parts of it, I didn't really look into what the whole\n> workflow you were trying to address is.\n>\n> So e.g. just to pick a random commit of your for show:\n>     $ git show c990a4c11dd | sed 's/$/Z/'\n> Here we end up also adding the whitespace indenting to the empty lines,\n> whereas if we were trying to feed this to an editor we'd place those\n> later Z's at the start of our line.\n\nI'm not sure what you mean by \"feed this to an editor\". Do you mean\nsending the output of `git show` to an editor? I'm guessing that's not\nwhat you mean, and that you instead are talking about editing the\ncommit message in an editor (say, via the \"reword\" option of `git\nrebase --interactive`).\n\n> Are notes different? Or are they just similarly indented? For commits we\n> don't insert that leading whitespace in the commit object, do notes get\n> that part wrong too?\n\nNotes don't store the indented blank lines; it's only at output time,\nsuch as with `git format-patch --notes` that the blank lines get\nindented along with the rest of the note text (just as is happening in\nyour `git show` example in which the entire commit message is being\nindented, including the blank lines).\n\n> It might be showing, but I've only used notes a few times, my main use\n> of them is Junio's amlog.\n\nI also have only used notes a few times.\n\n> So even for someone experienced in git, I think some show & tell of\n> step-by-step showing in the commit message how we end up with X before,\n> and have Y with this change would help a lot.\n\nThis all came about due to two unrelated circumstances: (1) a few\nmonths ago, I configured Emacs to highlight trailing whitespace, and\n(2) I decided to use `notes` to add commentary to a commit since,\nalthough I normally just write the commentary directly in the patch\nitself after running `git format-patch`, in this case, it likely will\nbe weeks or months before I finish the series, and was worried that\nI'd forget the intended commentary by that time, thus recorded it as a\nnote. Since I've almost never used notes, I ran `git format-patch\n--notes` as a test and was surprised to see the trailing whitespace on\nthe \"blank\" lines when viewing the patch in the editor.\n\nThis submission started as a single patch which just \"fixed\" the bug\nand added a test. Only after that was complete (but before I submitted\nthe patch), did I discover that other tests in the suite were failing\nsince the \"fix\" also changed git-log's default output format which\nincludes notes (indented). Since I so rarely use notes, I had either\nforgotten that git-log showed notes or didn't know in the first place.\nThe submission grew to multiple patches due to fixing those\nnewly-failing tests.\n\nAnyhow, since then, I've discovered that `git format-patch\n--range-diff` also indents blank lines. And you've now shown that `git\nshow` does, as well, so the behavior which triggered this \"fix\" turns\nout to be somewhat normal in this project, rather than a one-off \"bug\"\nin need of a fix.\n"},{"id":"435542","messageId":"87wnnn8kba.fsf@evledraar.gmail.com","threadId":"56400","inReplyTo":"CAPig+cQ+qVNBJqHmQgk6D1fbYHHJpAxhfwyBOgevi9Hvs6JYkw@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-09-11T10:39:31Z","receivedAt":"2021-09-11T10:42:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Sep 11 2021, Eric Sunshine wrote:\n\n> On Fri, Sep 10, 2021 at 9:59 PM Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> >> Eric Sunshine <sunshine@sunshineco.com> writes:\n>> >> > Have we made a decision about whether this patch series -- which\n>> >> > avoids indenting blank notes lines -- is desirable? Or are we worried\n>> >> > about backward-compatibility?\n>>\n>> This change per-se seems nice, but even having reviewed it to the point\n>> of rewriting parts of it, I didn't really look into what the whole\n>> workflow you were trying to address is.\n>>\n>> So e.g. just to pick a random commit of your for show:\n>>     $ git show c990a4c11dd | sed 's/$/Z/'\n>> Here we end up also adding the whitespace indenting to the empty lines,\n>> whereas if we were trying to feed this to an editor we'd place those\n>> later Z's at the start of our line.\n>\n> I'm not sure what you mean by \"feed this to an editor\". Do you mean\n> sending the output of `git show` to an editor? I'm guessing that's not\n> what you mean, and that you instead are talking about editing the\n> commit message in an editor (say, via the \"reword\" option of `git\n> rebase --interactive`).\n\nFeed it to whatever, maybe I have a commit message in my terminal I\nhighlight and copy/paste, my shell/terminal is highlighting line-endings\netc.\n\nI've got a default bias towards trimming this whitespace, I'm just\nwondering why notes are a special-case as opposed to our more general\nlog/notes etc. output.\n\n>> Are notes different? Or are they just similarly indented? For commits we\n>> don't insert that leading whitespace in the commit object, do notes get\n>> that part wrong too?\n>\n> Notes don't store the indented blank lines; it's only at output time,\n> such as with `git format-patch --notes` that the blank lines get\n> indented along with the rest of the note text (just as is happening in\n> your `git show` example in which the entire commit message is being\n> indented, including the blank lines).\n\nAh, so with your change we'd end up with trimmed notes, but not the\ntrimmed main body of the commit message?\n\nWe don't have to fix everything at once, just establishing context,\nmaybe it's useful for format-patch etc. in isolation...\n\n>> It might be showing, but I've only used notes a few times, my main use\n>> of them is Junio's amlog.\n>\n> I also have only used notes a few times.\n>\n>> So even for someone experienced in git, I think some show & tell of\n>> step-by-step showing in the commit message how we end up with X before,\n>> and have Y with this change would help a lot.\n>\n> This all came about due to two unrelated circumstances: (1) a few\n> months ago, I configured Emacs to highlight trailing whitespace, and\n> (2) I decided to use `notes` to add commentary to a commit since,\n> although I normally just write the commentary directly in the patch\n> itself after running `git format-patch`, in this case, it likely will\n> be weeks or months before I finish the series, and was worried that\n> I'd forget the intended commentary by that time, thus recorded it as a\n> note. Since I've almost never used notes, I ran `git format-patch\n> --notes` as a test and was surprised to see the trailing whitespace on\n> the \"blank\" lines when viewing the patch in the editor.\n>\n> This submission started as a single patch which just \"fixed\" the bug\n> and added a test. Only after that was complete (but before I submitted\n> the patch), did I discover that other tests in the suite were failing\n> since the \"fix\" also changed git-log's default output format which\n> includes notes (indented). Since I so rarely use notes, I had either\n> forgotten that git-log showed notes or didn't know in the first place.\n> The submission grew to multiple patches due to fixing those\n> newly-failing tests.\n>\n> Anyhow, since then, I've discovered that `git format-patch\n> --range-diff` also indents blank lines. And you've now shown that `git\n> show` does, as well, so the behavior which triggered this \"fix\" turns\n> out to be somewhat normal in this project, rather than a one-off \"bug\"\n> in need of a fix.\n\nPer the above I wouldn't mind this just being changed for all of them,\neven one at a time.\n"},{"id":"435626","messageId":"CAPig+cTRo_bLrCyhWC5on-HHco=H=3Mc6Xfi4gRP0xVE+Xk=BA@mail.gmail.com","threadId":"56400","inReplyTo":"87wnnn8kba.fsf@evledraar.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-09-12T05:53:23Z","receivedAt":"2021-09-12T05:53:37Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Sep 11, 2021 at 6:43 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Sat, Sep 11 2021, Eric Sunshine wrote:\n> > Notes don't store the indented blank lines; it's only at output time,\n> > such as with `git format-patch --notes` that the blank lines get\n> > indented along with the rest of the note text (just as is happening in\n> > your `git show` example in which the entire commit message is being\n> > indented, including the blank lines).\n>\n> Ah, so with your change we'd end up with trimmed notes, but not the\n> trimmed main body of the commit message?\n\nThat's correct. This \"fix\" is specific to the note-printing machinery\nwhich is invoked by (at least) git-format-patch and git-log.\n\n(Until your demonstration of git-show indentation, I wasn't even aware\nthat blank lines in commit messages were getting indented there, as\nwell.)\n\n> > Anyhow, since then, I've discovered that `git format-patch\n> > --range-diff` also indents blank lines. And you've now shown that `git\n> > show` does, as well, so the behavior which triggered this \"fix\" turns\n> > out to be somewhat normal in this project, rather than a one-off \"bug\"\n> > in need of a fix.\n>\n> Per the above I wouldn't mind this just being changed for all of them,\n> even one at a time.\n\nI'm not a fan of the trailing whitespace either, however, Junio does\nhave the concern that there may be some tooling somewhere which relies\nupon the \"indented blank lines\" (even if such tooling would not be\nrobust).\n"},{"id":"435627","messageId":"xmqqmtoikxt1.fsf@gitster.g","threadId":"56400","inReplyTo":"CAPig+cTRo_bLrCyhWC5on-HHco=H=3Mc6Xfi4gRP0xVE+Xk=BA@mail.gmail.com","subject":"Re: [PATCH 3/3] notes: don't indent empty lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-09-12T08:22:50Z","receivedAt":"2021-09-12T08:22:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> I'm not a fan of the trailing whitespace either, however, Junio does\n> have the concern that there may be some tooling somewhere which relies\n> upon the \"indented blank lines\" (even if such tooling would not be\n> robust).\n\nNote that such a \"concern\" is always relative.  If the upside were\nso great, perhaps risking possible breakage may be warranted.  FWIW,\nI am not a big fan of trailing whitespaces that human writers leave\nin what they write, either.\n\nBecause the patch text will be full of lines with trailing\nwhitespaces anyway due to a blank lines in the patch context,\nhowever, it does not sound so great an upside to tweak how the\nparagraphs taken from the notes are inserted.\n\nThanks.\n"}]}