Thread (1 message) 1 message, 1 author, 2017-06-15

Re: [PATCH 2/2] date: use localtime() for "-local" time formats

From: Junio C Hamano <hidden>
Date: 2017-06-15 21:40:50

René Scharfe [off-list ref] writes:
Am 15.06.2017 um 15:52 schrieb Jeff King:
quoted
But for the special case of the "-local" formats, we can
just skip the adjustment and use localtime() instead of
gmtime(). This makes --date=format-local:%Z work correctly,
showing the local timezone instead of an empty string.
Documentation/rev-list-options.txt should be updated to mention that %Z
is passed to strftime in the local case, no?
quoted
The new test checks the result for "UTC", our default
test-lib value for $TZ. Using something like EST5 might be
more interesting, but the actual zone string is
system-dependent (for instance, on my system it expands to
just EST). Hopefully "UTC" is vanilla enough that every
system treats it the same.

Signed-off-by: Jeff King <redacted>
---
I don't have a Windows system to test this on, but from the output Dscho
provided earlier, I believe this should pass.
The first patch applies with some fuzz on master of Git for Windows, the
second one applies cleanly.  A "typedef unsigned long timestamp_t;" is
required to compile it; such a fixup won't be needed for long, I guess.
t0006 succeeds.
This time, I'll do s/timestamp_t/unsigned long/ while queuing ;-)
Of course, it needs to be converted back to timestamp_t when the
topic is merged to a more recent integration branch that knows about
the type.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help