Re: [PATCH 2/2] date: use localtime() for "-local" time formats
- From
René Scharfe <l.s.r@web.de>
- Date
- Jun 15, 2017, 16:12 UTC
- Message-ID
- <b79d1c3d-e43e-a82b-2d33-2283cb0aa5ef@web.de>
- In-Reply-To
- <20170615135216.2jfsrjpicku6zxv3@sigill.intra.peff.net>
Am 15.06.2017 um 15:52 schrieb Jeff King:
> 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?
Show 11 quoted lines
> 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 <peff@peff.net> > --- > 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.
René