summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-11-20 00:51:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-20 04:33:36 (GMT)
commit618a855083fbd3b8f9491ec8b32b39bdea91868d (patch)
treedc1874f454598553c02d7ff2ec3204fb0c175c6c /pretty.c
parent0df621172d830adf36d4226b98f9cf4006d183a6 (diff)
downloadgit-618a855083fbd3b8f9491ec8b32b39bdea91868d.zip
git-618a855083fbd3b8f9491ec8b32b39bdea91868d.tar.gz
git-618a855083fbd3b8f9491ec8b32b39bdea91868d.tar.bz2
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 <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 61014cc..63fa600 100644
--- a/pretty.c
+++ b/pretty.c
@@ -20,6 +20,7 @@ static struct cmt_fmt_map {
int is_tformat;
int expand_tabs_in_log;
int is_alias;
+ enum date_mode_type default_date_mode_type;
const char *user_format;
} *commit_formats;
static size_t builtin_formats_len;
@@ -181,6 +182,8 @@ void get_commit_format(const char *arg, struct rev_info *rev)
rev->commit_format = commit_format->format;
rev->use_terminator = commit_format->is_tformat;
rev->expand_tabs_in_log_default = commit_format->expand_tabs_in_log;
+ if (!rev->date_mode_explicit && commit_format->default_date_mode_type)
+ rev->date_mode.type = commit_format->default_date_mode_type;
if (commit_format->format == CMIT_FMT_USERFORMAT) {
save_user_format(rev, commit_format->user_format,
commit_format->is_tformat);