git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 16:59 UTC

[PATCH v2 3/4] t3301: cover generic displayed notes behavior

From
Siddh Raman Pant <siddh.raman.pant@oracle.com>
Date
May 22, 2026, 16:09 UTC
Message-ID
<e494bea038262847ea14d223718f6059e52c1f40.1779464886.git.siddh.raman.pant@oracle.com>
In-Reply-To
<cover.1779464886.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
Previous: Siddh Raman PantNext: Siddh Raman Pant
Message 4 of 6 in “Add support for an external command for fetching notes”
  1. 0/4 Add support for an external command for fetching notesSiddh Raman Pant, May 22, 2026
  2. 1/4 notes: convert raw arg in format_display_notes() to boolSiddh Raman Pant, May 22, 2026
  3. 2/4 wrapper: add support for timeout and deadline in read helpersSiddh Raman Pant, May 22, 2026
  4. 3/4 t3301: cover generic displayed notes behaviorSiddh Raman Pant, May 22, 2026
  5. 4/4 notes: support an external command to display notesSiddh Raman Pant, May 22, 2026
  6. Siddh Raman PantMay 23, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.