From cd1957f5fc6ecc5ae557246126d9e74c029ccd61 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 16 Dec 2011 06:40:24 -0500 Subject: pretty: give placeholders to reflog identity 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 Signed-off-by: Junio C Hamano --- reflog-walk.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'reflog-walk.c') 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) { -- cgit v1.2.3