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>
This commit is contained in:
committed by
Shawn O. Pearce
parent
1be224ba6e
commit
f4ea32f0b4
@ -81,7 +81,8 @@ struct rev_info {
|
||||
show_merge:1,
|
||||
abbrev_commit:1,
|
||||
use_terminator:1,
|
||||
missing_newline:1;
|
||||
missing_newline:1,
|
||||
date_mode_explicit:1;
|
||||
enum date_mode date_mode;
|
||||
|
||||
unsigned int abbrev;
|
||||
|
||||
Reference in New Issue
Block a user