From: Siddh Raman Pant Date: Fri, 22 May 2026 16:09:37 GMT Subject: [PATCH v2 3/4] t3301: cover generic displayed notes behavior Message-ID: In-Reply-To: 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 --- 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