From acdd37769de8b0fe37a74bfc0475b63bdc55e9dc Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 17 Jan 2019 23:18:01 -0700 Subject: Add 'human' date format This adds --date=human, which skips the timezone if it matches the current time-zone, and doesn't print the whole date if that matches (ie skip printing year for dates that are "this year", but also skip the whole date itself if it's in the last few days and we can just say what weekday it was). For really recent dates (same day), use the relative date stamp, while for old dates (year doesn't match), don't bother with time and timezone. Also add 'auto' date mode, which defaults to human if we're using the pager. So you can do git config --add log.date auto and your "git log" commands will show the human-legible format unless you're scripting things. Note that this time format still shows the timezone for recent enough events (but not so recent that they show up as relative dates). You can combine it with the "-local" suffix to never show timezones for an even more simplified view. Signed-off-by: Linus Torvalds Signed-off-by: Stephen P. Smith Signed-off-by: Junio C Hamano --- cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index d49092d94d..8a6810ee6a 100644 --- a/cache.h +++ b/cache.h @@ -1428,6 +1428,7 @@ extern struct object *peel_to_type(const char *name, int namelen, struct date_mode { enum date_mode_type { DATE_NORMAL = 0, + DATE_HUMAN, DATE_RELATIVE, DATE_SHORT, DATE_ISO8601, -- cgit v1.2.3