From: Junio C Hamano Date: Thu, 26 Mar 2009 07:28:22 +0000 (-0700) Subject: Merge branch 'jc/maint-1.6.0-blame-s' X-Git-Tag: v1.6.3-rc0~80 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3fcee259d023087184c63eedf1015be6e23ea6e1;p=git.git Merge branch 'jc/maint-1.6.0-blame-s' * jc/maint-1.6.0-blame-s: blame: read custom grafts given by -S before calling setup_revisions() Conflicts: builtin-blame.c --- 3fcee259d023087184c63eedf1015be6e23ea6e1 diff --cc builtin-blame.c index 2aedd17c3,0c241a9ec..83141fc84 --- a/builtin-blame.c +++ b/builtin-blame.c @@@ -2250,36 -2346,10 +2250,40 @@@ int cmd_blame(int argc, const char **ar parse_done: argc = parse_options_end(&ctx); + if (revs_file && read_ancestry(revs_file)) + die("reading graft file %s failed: %s", + revs_file, strerror(errno)); + + if (cmd_is_annotate) { + output_option |= OUTPUT_ANNOTATE_COMPAT; + blame_date_mode = DATE_ISO8601; + } else { + blame_date_mode = revs.date_mode; + } + + /* The maximum width used to show the dates */ + switch (blame_date_mode) { + case DATE_RFC2822: + blame_date_width = sizeof("Thu, 19 Oct 2006 16:00:04 -0700"); + break; + case DATE_ISO8601: + blame_date_width = sizeof("2006-10-19 16:00:04 -0700"); + break; + case DATE_RAW: + blame_date_width = sizeof("1161298804 -0700"); + break; + case DATE_SHORT: + blame_date_width = sizeof("2006-10-19"); + break; + case DATE_RELATIVE: + /* "normal" is used as the fallback for "relative" */ + case DATE_LOCAL: + case DATE_NORMAL: + blame_date_width = sizeof("Thu Oct 19 16:00:04 2006 -0700"); + break; + } + blame_date_width -= 1; /* strip the null */ + if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER)) opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE | PICKAXE_BLAME_COPY_HARDER); @@@ -2418,11 -2488,7 +2422,7 @@@ sb.ent = ent; sb.path = path; - if (revs_file && read_ancestry(revs_file)) - die("reading graft file %s failed: %s", - revs_file, strerror(errno)); - - read_mailmap(&mailmap, ".mailmap", NULL); + read_mailmap(&mailmap, NULL); if (!incremental) setup_pager();