|
22 | 22 | #include "branch.h"
|
23 | 23 | #include "streaming.h"
|
24 | 24 | #include "version.h"
|
| 25 | +#include "mailmap.h" |
25 | 26 |
|
26 | 27 | /* Set a default date-time format for git log ("log.date" config variable) */
|
27 | 28 | static const char *default_date_mode = NULL;
|
@@ -94,11 +95,12 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
|
94 | 95 | struct rev_info *rev, struct setup_revision_opt *opt)
|
95 | 96 | {
|
96 | 97 | struct userformat_want w;
|
97 |
| - int quiet = 0, source = 0; |
| 98 | + int quiet = 0, source = 0, mailmap = 0; |
98 | 99 |
|
99 | 100 | const struct option builtin_log_options[] = {
|
100 | 101 | OPT_BOOLEAN(0, "quiet", &quiet, N_("suppress diff output")),
|
101 | 102 | OPT_BOOLEAN(0, "source", &source, N_("show source")),
|
| 103 | + OPT_BOOLEAN(0, "use-mailmap", &mailmap, N_("Use mail map file")), |
102 | 104 | { OPTION_CALLBACK, 0, "decorate", NULL, NULL, N_("decorate options"),
|
103 | 105 | PARSE_OPT_OPTARG, decorate_callback},
|
104 | 106 | OPT_END()
|
@@ -136,6 +138,11 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
|
136 | 138 | if (source)
|
137 | 139 | rev->show_source = 1;
|
138 | 140 |
|
| 141 | + if (mailmap) { |
| 142 | + rev->mailmap = xcalloc(1, sizeof(struct string_list)); |
| 143 | + read_mailmap(rev->mailmap, NULL); |
| 144 | + } |
| 145 | + |
139 | 146 | if (rev->pretty_given && rev->commit_format == CMIT_FMT_RAW) {
|
140 | 147 | /*
|
141 | 148 | * "log --pretty=raw" is special; ignore UI oriented
|
|
0 commit comments