From: Junio C Hamano Date: Fri, 6 May 2011 17:50:32 +0000 (-0700) Subject: Merge branch 'js/blame-parsename' X-Git-Tag: v1.7.6-rc0~101 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2190a43c42a049d75344a381f3c8d947876c997b?ds=inline;hp=-c Merge branch 'js/blame-parsename' * js/blame-parsename: t/annotate-tests: Use echo & cat instead of sed blame: tolerate bogus e-mail addresses a bit better --- 2190a43c42a049d75344a381f3c8d947876c997b diff --combined builtin/blame.c index 4639788178,41525f1ea1..4242e4b513 --- a/builtin/blame.c +++ b/builtin/blame.c @@@ -41,7 -41,6 +41,7 @@@ static int reverse static int blank_boundary; static int incremental; static int xdl_opts; +static int abbrev = -1; static enum date_mode blame_date_mode = DATE_ISO8601; static size_t blame_date_width; @@@ -1378,7 -1377,7 +1378,7 @@@ static void get_ac_line(const char *inb timepos = tmp; *tmp = 0; - while (person < tmp && *tmp != ' ') + while (person < tmp && !(*tmp == ' ' && tmp[1] == '<')) tmp--; if (tmp <= person) return; @@@ -1671,7 -1670,7 +1671,7 @@@ static void emit_other(struct scoreboar cp = nth_line(sb, ent->lno); for (cnt = 0; cnt < ent->num_lines; cnt++) { char ch; - int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? 40 : 8; + int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? 40 : abbrev; if (suspect->commit->object.flags & UNINTERESTING) { if (blank_boundary) @@@ -2311,7 -2310,6 +2311,7 @@@ int cmd_blame(int argc, const char **ar { OPTION_CALLBACK, 'C', NULL, &opt, "score", "Find line copies within and across files", PARSE_OPT_OPTARG, blame_copy_callback }, { OPTION_CALLBACK, 'M', NULL, &opt, "score", "Find line movements within and across files", PARSE_OPT_OPTARG, blame_move_callback }, OPT_CALLBACK('L', NULL, &bottomtop, "n,m", "Process only line range n,m, counting from 1", blame_bottomtop_callback), + OPT__ABBREV(&abbrev), OPT_END() }; @@@ -2347,11 -2345,6 +2347,11 @@@ parse_done: argc = parse_options_end(&ctx); + if (abbrev == -1) + abbrev = default_abbrev; + /* one more abbrev length is needed for the boundary commit */ + abbrev++; + if (revs_file && read_ancestry(revs_file)) die_errno("reading graft file '%s' failed", revs_file);