summaryrefslogtreecommitdiff
path: root/builtin-blame.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-05 07:57:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-09-05 07:57:35 (GMT)
commit7ceacdffc5c05f9a763b4cb6ea7cb528004643c3 (patch)
tree309b7e02e247486812f49ab83b34646b7508b51d /builtin-blame.c
parentf88d225feb117f0429540da90b2552e198fa2e82 (diff)
downloadgit-7ceacdffc5c05f9a763b4cb6ea7cb528004643c3.zip
git-7ceacdffc5c05f9a763b4cb6ea7cb528004643c3.tar.gz
git-7ceacdffc5c05f9a763b4cb6ea7cb528004643c3.tar.bz2
"blame -c" should be compatible with "annotate"
There is no reason to have a separate variable cmd_is_annotate; OUTPUT_ANNOTATE_COMPAT option is supposed to produce the compatibility output, and we should produce the same output even when the command was not invoked as "annotate" but as "blame -c". Noticed by Pasky. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-blame.c')
-rw-r--r--builtin-blame.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin-blame.c b/builtin-blame.c
index d2fc68c..9bc901c 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -38,7 +38,6 @@ static int show_root;
static int reverse;
static int blank_boundary;
static int incremental;
-static int cmd_is_annotate;
static int xdl_opts = XDF_NEED_MINIMAL;
static struct string_list mailmap;
@@ -1686,7 +1685,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
if (suspect->commit->object.flags & UNINTERESTING) {
if (blank_boundary)
memset(hex, ' ', length);
- else if (!cmd_is_annotate) {
+ else if (!(opt & OUTPUT_ANNOTATE_COMPAT)) {
length--;
putchar('^');
}
@@ -2317,8 +2316,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
};
struct parse_opt_ctx_t ctx;
-
- cmd_is_annotate = !strcmp(argv[0], "annotate");
+ int cmd_is_annotate = !strcmp(argv[0], "annotate");
git_config(git_blame_config, NULL);
init_revisions(&revs, NULL);
@@ -2346,6 +2344,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);
+ if (cmd_is_annotate)
+ output_option |= OUTPUT_ANNOTATE_COMPAT;
+
if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
PICKAXE_BLAME_COPY_HARDER);