diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:24 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:24 -0800 |
commit | ecbe1beb8e41664ac00581234a449c4487600e1d (patch) | |
tree | d53750776f3409aa3b3646c2b4027ac487e6c70a /cache.h | |
parent | 13e263095b55c88b7af86c3c88f8b0f937eb4d5c (diff) | |
parent | 110a6a161d304cac5e50306c70510f38000224bb (diff) | |
download | git-ecbe1beb8e41664ac00581234a449c4487600e1d.tar.gz |
Merge branch 'lt/date-human'
A new date format "--date=human" that morphs its output depending
on how far the time is from the current time has been introduced.
"--date=auto" can be used to use this new format when the output is
going to the pager or to the terminal and otherwise the default
format.
* lt/date-human:
Add `human` date format tests.
Add `human` format to test-tool
Add 'human' date format documentation
Replace the proposed 'auto' mode with 'auto:'
Add 'human' date format
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1463,6 +1463,7 @@ extern struct object *peel_to_type(const char *name, int namelen, enum date_mode_type { DATE_NORMAL = 0, + DATE_HUMAN, DATE_RELATIVE, DATE_SHORT, DATE_ISO8601, @@ -1490,6 +1491,8 @@ struct date_mode *date_mode_from_type(enum date_mode_type type); const char *show_date(timestamp_t time, int timezone, const struct date_mode *mode); void show_date_relative(timestamp_t time, const struct timeval *now, struct strbuf *timebuf); +void show_date_human(timestamp_t time, int tz, const struct timeval *now, + struct strbuf *timebuf); int parse_date(const char *date, struct strbuf *out); int parse_date_basic(const char *date, timestamp_t *timestamp, int *offset); int parse_expiry_date(const char *date, timestamp_t *timestamp); |