diff options
author | Jeff King <peff@peff.net> | 2011-12-16 06:40:24 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-12-16 13:00:15 -0800 |
commit | cd1957f5fc6ecc5ae557246126d9e74c029ccd61 (patch) | |
tree | 0efe0b7c1d87b3c038fd55696a53a2a76db30148 /reflog-walk.c | |
parent | 7b6c5836cf02999955b68c79f1cf2d13040acbc3 (diff) | |
download | git-cd1957f5fc6ecc5ae557246126d9e74c029ccd61.tar.gz |
pretty: give placeholders to reflog identityjk/pretty-reglog-ent
When doing a reflog walk, you can get some information about
the reflog (such as the subject line), but not the identity
information (i.e., name and email).
Let's make those available, mimicing the options for author
and committer identity.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reflog-walk.c')
-rw-r--r-- | reflog-walk.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/reflog-walk.c b/reflog-walk.c index 5d81d39a52..590737e844 100644 --- a/reflog-walk.c +++ b/reflog-walk.c @@ -291,6 +291,18 @@ void get_reflog_message(struct strbuf *sb, strbuf_add(sb, info->message, len); } +const char *get_reflog_ident(struct reflog_walk_info *reflog_info) +{ + struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog; + struct reflog_info *info; + + if (!commit_reflog) + return NULL; + + info = &commit_reflog->reflogs->items[commit_reflog->recno+1]; + return info->email; +} + void show_reflog_message(struct reflog_walk_info *reflog_info, int oneline, enum date_mode dmode) { |