git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: git@vger.kernel.org
Subject: [PATCH 3/4] blame: do not show boundary commits, only those blamed
Date: Mon, 25 May 2020 22:57:50 +0100	[thread overview]
Message-ID: <20200525215751.1735-4-philipoakley@iee.email> (raw)
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


  parent reply	other threads:[~2020-05-25 21:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 21:57 [PATCH 0/4] Selectively show only blamed limes Philip Oakley
2020-05-25 21:57 ` [PATCH 1/4] doc: blame: show the boundary commit '^' caret mark Philip Oakley
2020-05-25 21:57 ` [PATCH 2/4] blame: add option to show only blamed commits `--blame-only` Philip Oakley
2020-05-25 21:57 ` Philip Oakley [this message]
2020-05-25 21:57 ` [PATCH 4/4] blame: test the -b option, use blank oid for boundary commits Philip Oakley
2020-05-27  7:30   ` Jeff King
2020-05-27 10:52     ` Philip Oakley
2020-05-27  7:23 ` [PATCH 0/4] Selectively show only blamed limes Jeff King
2020-05-27 10:24   ` Philip Oakley
2020-05-28 16:45     ` Jeff King
2020-05-28 18:30       ` Junio C Hamano
2020-05-30 16:18         ` Philip Oakley
2020-05-31 16:02       ` Junio C Hamano
2020-05-31 16:28         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200525215751.1735-4-philipoakley@iee.email \
    --to=philipoakley@iee.email \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).