From 642833db78aa5d7a72677aa9a9b013fb9a880f19 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 22 Jul 2016 15:51:49 -0400 Subject: date: add "unix" format We already have "--date=raw", which is a Unix epoch timestamp plus a contextual timezone (either the author's or the local). But one may not care about the timezone and just want the epoch timestamp by itself. It's not hard to parse the two apart, but if you are using a pretty-print format, you may want git to show the "finished" form that the user will see. We can accomodate this by adding a new date format, "unix", which is basically "raw" without the timezone. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/blame.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtin/blame.c') diff --git a/builtin/blame.c b/builtin/blame.c index 7417edf6ef..002e70f9b5 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2626,6 +2626,9 @@ parse_done: case DATE_RAW: blame_date_width = sizeof("1161298804 -0700"); break; + case DATE_UNIX: + blame_date_width = sizeof("1161298804"); + break; case DATE_SHORT: blame_date_width = sizeof("2006-10-19"); break; -- cgit v1.2.3