Skip to content

Commit 618a855

Browse files
Denton-Lgitster
authored andcommitted
pretty: add struct cmt_fmt_map::default_date_mode_type
In a future commit, we plan on having a pretty format which will use a default date format unless otherwise overidden. Add support for this by adding a `default_date_mode_type` member in `struct cmt_fmt_map`. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0df6211 commit 618a855

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pretty.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ static struct cmt_fmt_map {
2020
int is_tformat;
2121
int expand_tabs_in_log;
2222
int is_alias;
23+
enum date_mode_type default_date_mode_type;
2324
const char *user_format;
2425
} *commit_formats;
2526
static size_t builtin_formats_len;
@@ -181,6 +182,8 @@ void get_commit_format(const char *arg, struct rev_info *rev)
181182
rev->commit_format = commit_format->format;
182183
rev->use_terminator = commit_format->is_tformat;
183184
rev->expand_tabs_in_log_default = commit_format->expand_tabs_in_log;
185+
if (!rev->date_mode_explicit && commit_format->default_date_mode_type)
186+
rev->date_mode.type = commit_format->default_date_mode_type;
184187
if (commit_format->format == CMIT_FMT_USERFORMAT) {
185188
save_user_format(rev, commit_format->user_format,
186189
commit_format->is_tformat);

0 commit comments

Comments
 (0)