git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] blame: do not show boundary commits, only those blamed

From
Philip Oakley <philipoakley@iee.email>
Date
May 25, 2020, 21:57 UTC
Message-ID
<20200525215751.1735-4-philipoakley@iee.email>
In-Reply-To
<20200525215751.1735-1-philipoakley@iee.email>
Make the option functional and add tests
Signed-off-by: Philip Oakley <philipoakley@iee.email>
---
 builtin/blame.c  | 1 +
 t/t8002-blame.sh | 7 +++++++
 2 files changed, 8 insertions(+)
diff --git a/builtin/blame.c b/builtin/blame.c
index b699c777c4..61e5a7ff44 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -475,6 +475,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
 			fputs(color, stdout);
 
 		if (suspect->commit->object.flags & UNINTERESTING) {
+			if (blame_only) continue;
 			if (blank_boundary)
 				memset(hex, ' ', length);
 			else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh
index eea048e52c..d4877c7c54 100755
--- a/t/t8002-blame.sh
+++ b/t/t8002-blame.sh
@@ -122,4 +122,11 @@ test_expect_success '--exclude-promisor-objects does not BUG-crash' '
 	test_must_fail git blame --exclude-promisor-objects one
 '
 
+test_expect_success 'test --blame-only, exclude boundary commits' '
+	git blame --blame-only branch1.. -- file >actual &&
+	git blame branch1.. -- file >full &&
+	sed -e "/^\^/d" full >expected &&
+	test_cmp expected actual
+'
+
 test_done
-- 
2.26.2.windows.1.13.g9dddff6983
Previous: Philip OakleyNext: Philip Oakley
Message 4 of 14 in “Selectively show only blamed limes”
  1. 0/4 Selectively show only blamed limesPhilip Oakley, May 25, 2020
  2. 1/4 doc: blame: show the boundary commit '^' caret markPhilip Oakley, May 25, 2020
  3. 2/4 blame: add option to show only blamed commits `--blame-only`Philip Oakley, May 25, 2020
  4. 3/4 blame: do not show boundary commits, only those blamedPhilip Oakley, May 25, 2020
  5. 4/4 blame: test the -b option, use blank oid for boundary commits.Philip Oakley, May 25, 2020
  6. Jeff KingMay 27, 2020
  7. Philip OakleyMay 27, 2020
  8. Jeff KingMay 27, 2020
  9. Philip OakleyMay 27, 2020
  10. Jeff KingMay 28, 2020
  11. Junio C HamanoMay 28, 2020
  12. Philip OakleyMay 30, 2020
  13. Junio C HamanoMay 31, 2020
  14. Junio C HamanoMay 31, 2020

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.