summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-09-24 04:28:15 -0400
committerShawn O. Pearce <spearce@spearce.org>2009-09-29 10:06:49 -0700
commitf4ea32f0b48bc300afcb7c980c5a294deba31daa (patch)
tree74df0bb631868cd5483b62f301ba0e854969bd55 /log-tree.c
parent1be224ba6e99f0ab34c998d7fa8023b76a15c8b6 (diff)
downloadgit-f4ea32f0b48bc300afcb7c980c5a294deba31daa.tar.gz
improve reflog date/number heuristic
When we show a reflog, we have two ways of naming the entry: by sequence number (e.g., HEAD@{0}) or by date (e.g., HEAD@{10 minutes ago}). There is no explicit option to set one or the other, but we guess based on whether or not the user has provided us with a date format, showing them the date version if they have done so, and the sequence number otherwise. This usually made sense if the use did something like "git log -g --date=relative". However, it didn't make much sense if the user set the date format using the log.date config variable; in that case, all of their reflogs would end up as dates. This patch records the source of the date format and only triggers the date-based view if --date= was given on the command line. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/log-tree.c b/log-tree.c
index 1c9eefee33..1618f3c79a 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -390,7 +390,9 @@ void show_log(struct rev_info *opt)
*/
show_reflog_message(opt->reflog_info,
opt->commit_format == CMIT_FMT_ONELINE,
- opt->date_mode);
+ opt->date_mode_explicit ?
+ opt->date_mode :
+ DATE_NORMAL);
if (opt->commit_format == CMIT_FMT_ONELINE)
return;
}