Re: Bug in "git blame -C"

From: Junio C Hamano <junkio@cox.net>
Date: 2006-11-29 17:21:05
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;

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Nov 29 17:21:28 2006

This archive was generated by hypermail 2.1.8 : 2006-11-29 17:22:42 EST