summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f88d225)
raw | patch | inline | side by side (parent: f88d225)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 5 Sep 2008 07:57:35 +0000 (00:57 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 5 Sep 2008 07:57:35 +0000 (00:57 -0700) |
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>
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>
builtin-blame.c | patch | blob | history | |
t/t9400-git-cvsserver-server.sh | patch | blob | history |
diff --git a/builtin-blame.c b/builtin-blame.c
index d2fc68c68a02d87c1f61442f8bbbc66c07b5b8d0..9bc901c2922403dcf73c8275da73d6d37d220729 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
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('^');
}
};
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);
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);
index 4b91f8d4c45dad075d69028c9c70aa9cb1959e2b..c1850d29239f8846c42b4552493d2d4898fa221e 100755 (executable)
! grep -v "^master[ ]\+master$" < out
'
+#------------
+# CVS ANNOTATE
+#------------
+
+cd "$WORKDIR"
+test_expect_success 'cvs annotate' '
+ cd cvswork &&
+ GIT_CONFIG="$git_config" cvs annotate merge >../out &&
+ sed -e "s/ .*//" ../out >../actual &&
+ for i in 3 1 1 1 1 1 1 1 2 4; do echo 1.$i; done >../expect &&
+ test_cmp ../expect ../actual
+'
+
test_done