[PATCH 6/9] t3301: cover generic displayed notes behavior
- From
Siddh Raman Pant <siddh.raman.pant@oracle.com>
- Date
- May 19, 2026, 16:30 UTC
- Message-ID
- <70f22e5318ec25acc43fd7818a781391a31e2fd5.1779207350.git.siddh.raman.pant@oracle.com>
- In-Reply-To
- <cover.1779207350.git.siddh.raman.pant@oracle.com>
Displayed notes already participate in common log behavior. Add explicit coverage for raw notes formatting, --no-notes suppression, explicit notes refs, and --grep matching before teaching external notes to feed the same display path.
Assisted-by: Codex:gpt-5.5-xhigh-fast Signed-off-by: Siddh Raman Pant <siddh.raman.pant@oracle.com> --- t/t3301-notes.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh index d6c50460d086..27439010dfbc 100755 --- a/t/t3301-notes.sh +++ b/t/t3301-notes.sh @@ -885,6 +885,30 @@ test_expect_success '--show-notes=ref accumulates' ' test_cmp expect-both-reversed actual ' +test_expect_success 'displayed notes honor raw notes formatting' ' + git show -s --format=%N >actual && + test_grep "^order test$" actual && + ! grep "Notes" actual +' + +test_expect_success 'displayed notes are suppressed by --no-notes' ' + git log --no-notes -1 >actual && + test_cmp expect-not-other actual +' + +test_expect_success 'explicit notes ref replaces default displayed notes' ' + git log --notes=other -1 >actual && + test_cmp expect-other actual +' + +test_expect_success 'displayed notes are used for grep matching' ' + commit=$(git rev-parse HEAD) && + git log --grep="order test" -1 >actual && + test_grep "^commit $commit$" actual && + git log --no-notes --grep="order test" -1 >actual && + test_must_be_empty actual +' + test_expect_success 'Allow notes on non-commits (trees, blobs, tags)' ' test_config core.notesRef refs/notes/other && echo "Note on a tree" >expect &&
-- 2.53.0