Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: Bug in "git blame -C"
Date: Tue, 28 Nov 2006 22:21:05 -0800	[thread overview]
Message-ID: <7vmz6au626.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vu00iu7lb.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Tue, 28 Nov 2006 21:48:00 -0800")

Junio C Hamano <junkio@cox.net> writes:

> Linus Torvalds <torvalds@osdl.org> writes:
>
>>  - "git blame -C" has apparently decided that it doesn't need to show 
>>    filenames that things came from, because they all came from the same 
>>    commit, but that's not a logical thing to compare. "same commit" does 
>>    not mean "same filename", so not showing the filename makes no sense.
>
> This is definitely a bug,

A replacement patch that should be much cleaner and to the
point.

---

diff --git a/builtin-blame.c b/builtin-blame.c
index 066dee7..4090a80 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -1435,11 +1435,12 @@ static void find_alignment(struct scoreboard *sb, int *option)
 		struct commit_info ci;
 		int num;
 
+		if (strcmp(suspect->path, sb->path))
+			*option |= OUTPUT_SHOW_NAME | OUTPUT_SHOW_NUMBER;
+
 		if (!(suspect->commit->object.flags & METAINFO_SHOWN)) {
 			suspect->commit->object.flags |= METAINFO_SHOWN;
 			get_commit_info(suspect->commit, &ci, 1);
-			if (strcmp(suspect->path, sb->path))
-				*option |= OUTPUT_SHOW_NAME;
 			num = strlen(suspect->path);
 			if (longest_file < num)
 				longest_file = num;

  reply	other threads:[~2006-11-29  6:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29  4:27 Bug in "git blame -C" Linus Torvalds
2006-11-29  5:48 ` Junio C Hamano
2006-11-29  6:21   ` Junio C Hamano [this message]
2006-11-29  6:32     ` [PATCH (take 3)] git blame -C: fix output format tweaks when crossing file boundary 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

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

  git send-email \
    --in-reply-to=7vmz6au626.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox