blame: use .mailmap unconditionally
There really isn't any point in turning off .mailmap. The number of mailmap lookups are bounded by number of lines in the target file, and the real blame processing is much more expensive. If it turns out to be too costly, we should optimize the mailmap lookup itself, instead of avoiding the call. If the author information of commits of the project are relatively clean, .mailmap would have only small number of entries, and the overhead of looking it up will not be high. On the other hand, if the author information is really screwed up that a good .mailmap needs to be maintained to run shortlog, giving uncleaned names in blame output is not helpful at all either. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
May 2, 2007 at 23:58 UTC
50acc58914bf02217e55fdd739a844f2bfc45410
1 file changed
+2
-8
builtin-blame.c
+2
-8
@@ -20,13 +20,12 @@
20
#include "mailmap.h"
21
22
static char blame_usage[] =
23
-"git-blame [-c] [-b] [-l] [--root] [-x] [-t] [-f] [-n] [-s] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [--contents <filename>] [--incremental] [commit] [--] file\n"
23
+"git-blame [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [--contents <filename>] [--incremental] [commit] [--] file\n"
24
" -c Use the same output mode as git-annotate (Default: off)\n"
25
" -b Show blank SHA-1 for boundary commits (Default: off)\n"
26
" -l Show long commit SHA1 (Default: off)\n"
27
" --root Do not treat root commits as boundaries (Default: off)\n"
28
" -t Show raw timestamp (Default: off)\n"
29
-" -x Do not use .mailmap file\n"
29
" -f, --show-name Show original filename (Default: auto)\n"
30
" -n, --show-number Show original linenumber (Default: off)\n"
31
" -s Suppress author name and timestamp (Default: off)\n"
@@ -46,7 +45,6 @@ static int show_root;
45
static int blank_boundary;
46
static int incremental;
47
static int cmd_is_annotate;
49
-static int no_mailmap;
48
static struct path_list mailmap;
49
50
#ifndef DEBUG
@@ -2173,9 +2171,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2171
else if (!strcmp("-p", arg) ||
2172
!strcmp("--porcelain", arg))
2173
output_option |= OUTPUT_PORCELAIN;
2176
- else if (!strcmp("-x", arg) ||
2177
- !strcmp("--no-mailmap", arg))
2178
- no_mailmap = 1;
2174
else if (!strcmp("--", arg)) {
2175
seen_dashdash = 1;
2176
i++;
@@ -2375,8 +2370,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
2370
die("reading graft file %s failed: %s",
2371
revs_file, strerror(errno));
2372
2378
- if (!no_mailmap)
2379
- read_mailmap(&mailmap, ".mailmap", NULL);
2373
+ read_mailmap(&mailmap, ".mailmap", NULL);
2374
2375
assign_blame(&sb, &revs, opt);
2376