diff options
author | ZheNing Hu <adlternative@gmail.com> | 2021-04-25 13:41:45 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-04-27 10:09:32 +0300 |
commit | b722d4560e9d566cb8c6cdccf08d649df146eb6b (patch) | |
tree | 139de3aa4d73b836143c553ee3b1c7a51684e90e /pretty.c | |
parent | 3593ebd3f502d28eb405ce502cd9fbd743afc3fe (diff) |
pretty: provide human date format
Add the placeholders %ah and %ch to format author date and committer
date, like --date=human does, which provides more humanity date output.
Signed-off-by: ZheNing Hu <adlternative@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -745,6 +745,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 'h': /* date, human */ + strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(HUMAN))); + return placeholder_len; case 's': strbuf_addstr(sb, show_ident_date(&s, DATE_MODE(SHORT))); return placeholder_len; |