X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pretty.c;h=1580299d4037ada9e1f0e3c11c6c5578f44f52dd;hb=2b380d81917cb4205a0c13224086fdd9268d5b71;hp=230fe1cc82e3a3bf7c0fef604350868d917acef4;hpb=cd17abdf75207e01bb716c2c7c9f62e56f2f0fdb;p=git.git diff --git a/pretty.c b/pretty.c index 230fe1cc8..1580299d4 100644 --- a/pretty.c +++ b/pretty.c @@ -822,6 +822,23 @@ static void rewrap_message_tail(struct strbuf *sb, c->indent2 = new_indent2; } +static int format_reflog_person(struct strbuf *sb, + char part, + struct reflog_walk_info *log, + enum date_mode dmode) +{ + const char *ident; + + if (!log) + return 2; + + ident = get_reflog_ident(log); + if (!ident) + return 2; + + return format_person_part(sb, part, ident, strlen(ident), dmode); +} + static size_t format_commit_one(struct strbuf *sb, const char *placeholder, void *context) { @@ -963,6 +980,14 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder, if (c->pretty_ctx->reflog_info) get_reflog_message(sb, c->pretty_ctx->reflog_info); return 2; + case 'n': + case 'N': + case 'e': + case 'E': + return format_reflog_person(sb, + placeholder[1], + c->pretty_ctx->reflog_info, + c->pretty_ctx->date_mode); } return 0; /* unknown %g placeholder */ case 'N':