Thread (27 messages) flat view 27 messages, 6 authors, 2016-06-15

[RFC 2/5] Pretty Print: show tz when using DATE_LOCAL

From: Michael Witten <hidden>
Date: 2016-06-15 22:51:04
Subsystem: the rest · Maintainer: Linus Torvalds

Date: Fri, 11 Feb 2011 16:06:36 +0000
Currently, when the date mode is DATE_LOCAL, the
time zone is never pretty printed; this seems
to be an unnecessary pecularliarity, especially
when the time zone data could be useful to
the user.

This commit removes that special handling of
time zones.

Now, for instance, fast-import.c's write_crash_report()
will produce reports that provide more meaningful
dates.

Signed-off-by: Michael Witten <redacted>
---
 date.c                  |    3 +--
 t/t6300-for-each-ref.sh |    4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/date.c b/date.c
index 096468f..caa14fe 100644
--- a/date.c
+++ b/date.c
@@ -186,13 +186,12 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)
 			month_names[tm->tm_mon], tm->tm_year + 1900,
 			tm->tm_hour, tm->tm_min, tm->tm_sec, tz);
 	else
-		sprintf(timebuf, "%.3s %.3s %d %02d:%02d:%02d %d%c%+05d",
+		sprintf(timebuf, "%.3s %.3s %d %02d:%02d:%02d %d %+05d",
 				weekday_names[tm->tm_wday],
 				month_names[tm->tm_mon],
 				tm->tm_mday,
 				tm->tm_hour, tm->tm_min, tm->tm_sec,
 				tm->tm_year + 1900,
-				(mode == DATE_LOCAL) ? 0 : ' ',
 				tz);
 	return timebuf;
 }
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 7dc8a51..050ed7d 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -175,8 +175,8 @@ test_expect_success 'Check format "short" date fields output' '
 '
 
 cat >expected <<\EOF
-'refs/heads/master' 'Mon Jul 3 15:18:43 2006' 'Mon Jul 3 15:18:44 2006'
-'refs/tags/testtag' 'Mon Jul 3 15:18:45 2006'
+'refs/heads/master' 'Mon Jul 3 15:18:43 2006 +0000' 'Mon Jul 3 15:18:44 2006 +0000'
+'refs/tags/testtag' 'Mon Jul 3 15:18:45 2006 +0000'
 EOF
 
 test_expect_success 'Check format "local" date fields output' '
-- 
1.7.4.18.g68fe8
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help