@@ -662,6 +662,20 @@ test_expect_success 'range-diff with multiple --notes' '
662
662
test_cmp expect actual
663
663
'
664
664
665
+ # `range-diff` should act like `log` with regards to notes
666
+ test_expect_success ' range-diff with --notes=custom does not show default notes' '
667
+ git notes add -m "topic note" topic &&
668
+ git notes add -m "unmodified note" unmodified &&
669
+ git notes --ref=custom add -m "topic note" topic &&
670
+ git notes --ref=custom add -m "unmodified note" unmodified &&
671
+ test_when_finished git notes remove topic unmodified &&
672
+ test_when_finished git notes --ref=custom remove topic unmodified &&
673
+ git range-diff --notes=custom main..topic main..unmodified \
674
+ >actual &&
675
+ ! grep "## Notes ##" actual &&
676
+ grep "## Notes (custom) ##" actual
677
+ '
678
+
665
679
test_expect_success ' format-patch --range-diff does not compare notes by default' '
666
680
git notes add -m "topic note" topic &&
667
681
git notes add -m "unmodified note" unmodified &&
@@ -679,6 +693,20 @@ test_expect_success 'format-patch --range-diff does not compare notes by default
679
693
! grep "note" 0000-*
680
694
'
681
695
696
+ test_expect_success ' format-patch --notes=custom --range-diff only compares custom notes' '
697
+ git notes add -m "topic note" topic &&
698
+ git notes --ref=custom add -m "topic note (custom)" topic &&
699
+ git notes add -m "unmodified note" unmodified &&
700
+ git notes --ref=custom add -m "unmodified note (custom)" unmodified &&
701
+ test_when_finished git notes remove topic unmodified &&
702
+ test_when_finished git notes --ref=custom remove topic unmodified &&
703
+ git format-patch --notes=custom --cover-letter --range-diff=$prev \
704
+ main..unmodified >actual &&
705
+ test_when_finished "rm 000?-*" &&
706
+ grep "## Notes (custom) ##" 0000-* &&
707
+ ! grep "## Notes ##" 0000-*
708
+ '
709
+
682
710
test_expect_success ' format-patch --range-diff with --no-notes' '
683
711
git notes add -m "topic note" topic &&
684
712
git notes add -m "unmodified note" unmodified &&
0 commit comments