summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-11-20 00:51:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-20 04:33:36 (GMT)
commit0df621172d830adf36d4226b98f9cf4006d183a6 (patch)
tree81c0155cd4579ddf6a1b6a831bbc1655fa1c607d /pretty.c
parentac52d9410e5fad8d0bffa95e70e514c3fbd96871 (diff)
downloadgit-0df621172d830adf36d4226b98f9cf4006d183a6.zip
git-0df621172d830adf36d4226b98f9cf4006d183a6.tar.gz
git-0df621172d830adf36d4226b98f9cf4006d183a6.tar.bz2
pretty: provide short date format
Add the placeholders %as and %cs to format author date and committer date, respectively, without the time part, like --date=short does, i.e. like YYYY-MM-DD. Signed-off-by: René Scharfe <l.s.r@web.de> 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 da154af..61014cc 100644
--- a/pretty.c
+++ b/pretty.c
@@ -731,6 +731,9 @@ static size_t format_person_part(struct strbuf *sb, char part,
case 'I': /* date, ISO 8601 strict */
strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(ISO8601_STRICT)));
return placeholder_len;
+ case 's':
+ strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT)));
+ return placeholder_len;
}
skip: