summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-10-17 22:45:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-10-17 22:45:52 (GMT)
commit87b24a42eae8f33ccf28d0babbe91f0262feb7dc (patch)
tree25c2c9b77dad4341668def390fc45446a07d2aea /builtin
parentf8a3fd28fd9e61852f5944335e7338c52c8c5abd (diff)
parentea16794e4303e79f8acb01a93fb6b1762972ab86 (diff)
downloadgit-87b24a42eae8f33ccf28d0babbe91f0262feb7dc.zip
git-87b24a42eae8f33ccf28d0babbe91f0262feb7dc.tar.gz
git-87b24a42eae8f33ccf28d0babbe91f0262feb7dc.tar.bz2
Merge branch 'ap/commit-author-mailmap' into maint
* ap/commit-author-mailmap: commit: search author pattern against mailmap
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 10acc53..a48a7fe 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -30,6 +30,7 @@
#include "column.h"
#include "sequencer.h"
#include "notes-utils.h"
+#include "mailmap.h"
static const char * const builtin_commit_usage[] = {
N_("git commit [options] [--] <pathspec>..."),
@@ -935,6 +936,7 @@ static const char *find_author_by_nickname(const char *name)
struct rev_info revs;
struct commit *commit;
struct strbuf buf = STRBUF_INIT;
+ struct string_list mailmap = STRING_LIST_INIT_NODUP;
const char *av[20];
int ac = 0;
@@ -945,13 +947,17 @@ static const char *find_author_by_nickname(const char *name)
av[++ac] = buf.buf;
av[++ac] = NULL;
setup_revisions(ac, av, &revs, NULL);
+ revs.mailmap = &mailmap;
+ read_mailmap(revs.mailmap, NULL);
+
prepare_revision_walk(&revs);
commit = get_revision(&revs);
if (commit) {
struct pretty_print_context ctx = {0};
ctx.date_mode = DATE_NORMAL;
strbuf_release(&buf);
- format_commit_message(commit, "%an <%ae>", &buf, &ctx);
+ format_commit_message(commit, "%aN <%aE>", &buf, &ctx);
+ clear_mailmap(&mailmap);
return strbuf_detach(&buf, NULL);
}
die(_("No existing author found with '%s'"), name);