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>
This commit is contained in:

committed by
Junio C Hamano

parent
3593ebd3f5
commit
b722d4560e
3
pretty.c
3
pretty.c
@ -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;
|
||||
|
Reference in New Issue
Block a user