git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rene Kita <mail@rkta.de>
To: git@vger.kernel.org
Cc: "Øystein Walle" <oystwa@gmail.com>
Subject: [PATCH 1/2] blame: Make --show-name negatable
Date: Mon, 12 Sep 2022 07:45:14 +0200	[thread overview]
Message-ID: <20220912054515.29559-2-mail@rkta.de> (raw)
In-Reply-To: <20220912054515.29559-1-mail@rkta.de>

From: Øystein Walle <oystwa@gmail.com>

Signed-off-by: Øystein Walle <oystwa@gmail.com>
---
 builtin/blame.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/builtin/blame.c b/builtin/blame.c
index a9fe8cf7a6..cbaae91a8f 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -49,6 +49,7 @@ static int blank_boundary;
 static int incremental;
 static int xdl_opts;
 static int abbrev = -1;
+static int show_name = -1;
 static int no_whole_file_rename;
 static int show_progress;
 static char repeated_meta_color[COLOR_MAXLEN];
@@ -621,7 +622,8 @@ static void find_alignment(struct blame_scoreboard *sb, int *option)
 		if (compute_auto_abbrev)
 			auto_abbrev = update_auto_abbrev(auto_abbrev, suspect);
 		if (strcmp(suspect->path, sb->path))
-			*option |= OUTPUT_SHOW_NAME;
+			if (show_name == -1)
+				*option |= OUTPUT_SHOW_NAME;
 		num = strlen(suspect->path);
 		if (longest_file < num)
 			longest_file = num;
@@ -867,7 +869,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 		OPT_BOOL(0, "show-stats", &show_stats, N_("show work cost statistics")),
 		OPT_BOOL(0, "progress", &show_progress, N_("force progress reporting")),
 		OPT_BIT(0, "score-debug", &output_option, N_("show output score for blame entries"), OUTPUT_SHOW_SCORE),
-		OPT_BIT('f', "show-name", &output_option, N_("show original filename (Default: auto)"), OUTPUT_SHOW_NAME),
+		OPT_BOOL('f', "show-name", &show_name, N_("show original filename (Default: auto)")),
 		OPT_BIT('n', "show-number", &output_option, N_("show original linenumber (Default: off)"), OUTPUT_SHOW_NUMBER),
 		OPT_BIT('p', "porcelain", &output_option, N_("show in a format designed for machine consumption"), OUTPUT_PORCELAIN),
 		OPT_BIT(0, "line-porcelain", &output_option, N_("show porcelain format with per-line commit information"), OUTPUT_PORCELAIN|OUTPUT_LINE_PORCELAIN),
@@ -943,6 +945,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 	revs.diffopt.flags.follow_renames = 0;
 	argc = parse_options_end(&ctx);
 
+	if (show_name == 1)
+		output_option |= OUTPUT_SHOW_NAME;
+
 	prepare_repo_settings(the_repository);
 	the_repository->settings.command_requires_full_index = 0;
 
-- 
2.37.3.544.g5c9b9c0a4e


  reply	other threads:[~2022-09-12  5:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  5:45 [PATCH 0/2] blame: Make --show-name negatable Rene Kita
2022-09-12  5:45 ` Rene Kita [this message]
2022-09-12 13:25   ` [PATCH 1/2] " Øystein Walle
2022-09-12 16:30     ` Junio C Hamano
2022-09-13  8:56       ` Øystein Walle
2022-09-13  9:08         ` Rene Kita
2022-09-12  5:45 ` [PATCH 2/2] blame: Document that --show-name is negatable Rene Kita

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

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

  git send-email \
    --in-reply-to=20220912054515.29559-2-mail@rkta.de \
    --to=mail@rkta.de \
    --cc=git@vger.kernel.org \
    --cc=oystwa@gmail.com \
    /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.
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 NNTP newsgroup(s).