diff options
author | Denton Liu <liu.denton@gmail.com> | 2019-11-20 13:18:43 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-11-21 09:29:52 +0900 |
commit | 9f726e1b879f6cc191cf18e0b81dbea45eaee60d (patch) | |
tree | 6da033af4f7aafdc669585d6aef66f5a1a88adf3 /t/t3206-range-diff.sh | |
parent | 3bdbdfb7a5a3f0077c3593cd53868cd38b569ead (diff) | |
download | git-9f726e1b879f6cc191cf18e0b81dbea45eaee60d.tar.gz |
range-diff: output `## Notes ##` header
When notes were included in the output of range-diff, they were just
mashed together with the rest of the commit message. As a result, users
wouldn't be able to clearly distinguish where the commit message ended
and where the notes started.
Output a `## Notes ##` header when notes are detected so that notes can
be compared more clearly.
Note that we handle case of `Notes (<ref>): -> ## Notes (<ref>) ##` with
this code as well. We can't test this in this patch, however, since
there is currently no way to pass along different notes refs to `git
log`. This will be fixed in a future patch.
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3206-range-diff.sh')
-rwxr-xr-x | t/t3206-range-diff.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/t/t3206-range-diff.sh b/t/t3206-range-diff.sh index 19ba644933..b936c16dd1 100755 --- a/t/t3206-range-diff.sh +++ b/t/t3206-range-diff.sh @@ -516,10 +516,10 @@ test_expect_success 'range-diff compares notes by default' ' 2: $(test_oid t2) = 2: $(test_oid u2) s/4/A/ 3: $(test_oid t3) = 3: $(test_oid u3) s/11/B/ 4: $(test_oid t4) ! 4: $(test_oid u4) s/12/B/ - @@ Metadata + @@ Commit message Z - Z ## Commit message ## - Z s/12/B/ + Z + Z ## Notes ## - topic note + unmodified note Z @@ -543,17 +543,17 @@ test_expect_success 'format-patch --range-diff compares notes by default' ' grep "= 3: .* s/11/B" 0000-* && grep "! 4: .* s/12/B" 0000-* && sed s/Z/\ /g >expect <<-EOF && - @@ Metadata + @@ Commit message Z - Z ## Commit message ## - Z s/12/B/ + Z + Z ## Notes ## - topic note + unmodified note Z Z ## file ## Z@@ file: A EOF - sed "/@@ Metadata/,/@@ file: A/!d" 0000-* >actual && + sed "/@@ Commit message/,/@@ file: A/!d" 0000-* >actual && test_cmp expect actual ' |