Skip to content

Commit 302e99b

Browse files
committed
Merge branch 'jk/reflog-date'
* jk/reflog-date: improve reflog date/number heuristic
2 parents 170a481 + f4ea32f commit 302e99b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

log-tree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ void show_log(struct rev_info *opt)
390390
*/
391391
show_reflog_message(opt->reflog_info,
392392
opt->commit_format == CMIT_FMT_ONELINE,
393-
opt->date_mode);
393+
opt->date_mode_explicit ?
394+
opt->date_mode :
395+
DATE_NORMAL);
394396
if (opt->commit_format == CMIT_FMT_ONELINE)
395397
return;
396398
}

revision.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,8 +1159,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
11591159
revs->simplify_history = 0;
11601160
} else if (!strcmp(arg, "--relative-date")) {
11611161
revs->date_mode = DATE_RELATIVE;
1162+
revs->date_mode_explicit = 1;
11621163
} else if (!strncmp(arg, "--date=", 7)) {
11631164
revs->date_mode = parse_date_format(arg + 7);
1165+
revs->date_mode_explicit = 1;
11641166
} else if (!strcmp(arg, "--log-size")) {
11651167
revs->show_log_size = 1;
11661168
}

revision.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ struct rev_info {
8181
show_merge:1,
8282
abbrev_commit:1,
8383
use_terminator:1,
84-
missing_newline:1;
84+
missing_newline:1,
85+
date_mode_explicit:1;
8586
enum date_mode date_mode;
8687

8788
unsigned int abbrev;

0 commit comments

Comments
 (0)