From: Junio C Hamano Date: Mon, 14 May 2012 18:46:16 +0000 (-0700) Subject: Merge branch 'jk/maint-reflog-walk-count-vs-time' into maint X-Git-Tag: v1.7.10.3~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=adc3a81ce21754595d6263c78f3ceac5b9bb30d9;p=git.git Merge branch 'jk/maint-reflog-walk-count-vs-time' into maint Gives a better DWIM behaviour for --pretty=format:%gd, "stash list", and "log -g", depending on how the starting point ("master" vs "master@{0}" vs "master@{now}") and date formatting options (e.g. "--date=iso") are given on the command line. By Jeff King (4) and Junio C Hamano (1) * jk/maint-reflog-walk-count-vs-time: reflog-walk: tell explicit --date=default from not having --date at all reflog-walk: always make HEAD@{0} show indexed selectors reflog-walk: clean up "flag" field of commit_reflog struct log: respect date_mode_explicit with --format:%gd t1411: add more selector index/date tests --- adc3a81ce21754595d6263c78f3ceac5b9bb30d9 diff --cc reflog-walk.c index 86d18843f,0c904fb2d..b2fbdb239 --- a/reflog-walk.c +++ b/reflog-walk.c @@@ -295,20 -301,8 +305,20 @@@ void get_reflog_message(struct strbuf * 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) + enum date_mode dmode, int force_date) { if (reflog_info && reflog_info->last_commit_reflog) { struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog; diff --cc reflog-walk.h index afb1ae3fd,3adccb018..50265f51c --- a/reflog-walk.h +++ b/reflog-walk.h @@@ -11,13 -11,12 +11,13 @@@ extern int add_reflog_for_walk(struct r extern void fake_reflog_parent(struct reflog_walk_info *info, struct commit *commit); extern void show_reflog_message(struct reflog_walk_info *info, int, - enum date_mode); + enum date_mode, int force_date); extern void get_reflog_message(struct strbuf *sb, struct reflog_walk_info *reflog_info); +extern const char *get_reflog_ident(struct reflog_walk_info *reflog_info); extern void get_reflog_selector(struct strbuf *sb, struct reflog_walk_info *reflog_info, - enum date_mode dmode, + enum date_mode dmode, int force_date, int shorten); #endif