summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 506e49f)
raw | patch | inline | side by side (parent: 506e49f)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 5 Oct 2006 21:06:22 +0000 (14:06 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 5 Oct 2006 22:05:41 +0000 (15:05 -0700) |
The new option makes the command's native output format show the
filename even when there were no renames in its history, to make
it simpler for Porcelains to parse its output.
Signed-off-by: Junio C Hamano <junkio@cox.net>
filename even when there were no renames in its history, to make
it simpler for Porcelains to parse its output.
Signed-off-by: Junio C Hamano <junkio@cox.net>
blame.c | patch | blob | history |
index 394b5c3617e2ba73d336de66e7bdb41264be777e..d830b293fdacb851909908f5ce4c1366ba669124 100644 (file)
--- a/blame.c
+++ b/blame.c
const char *buf;
int max_digits;
int longest_file, longest_author;
- int found_rename;
+ int show_name = 0;
const char *prefix = setup_git_directory();
git_config(git_default_config);
}
usage(blame_usage);
}
+ if (!strcmp(argv[i], "-f") ||
+ !strcmp(argv[i], "--show-name")) {
+ show_name = 1;
+ continue;
+ }
if (!strcmp(argv[i], "--")) {
options = 0;
continue;
longest_file = 0;
longest_author = 0;
- found_rename = 0;
for (i = 0; i < num_blame_lines; i++) {
struct commit *c = blame_lines[i];
struct util_info *u;
c = initial;
u = c->util;
- if (!found_rename && strcmp(filename, u->pathname))
- found_rename = 1;
+ if (!show_name && strcmp(filename, u->pathname))
+ show_name = 1;
if (longest_file < strlen(u->pathname))
longest_file = strlen(u->pathname);
get_commit_info(c, &ci);
i+1);
}
else {
- if (found_rename)
+ if (show_name)
printf(" %-*.*s", longest_file, longest_file,
u->pathname);
printf(" (%-*.*s %10s %*d) ",