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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 15, 2017 at 06:12:31PM +0200, René Scharfe wrote:

> 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?

I wasn't sure if we wanted to get into that. Your documentation update
(with an empty string) says only that they are "handled internally".
While it is true that we aren't handling %Z internally anymore, the
point is that we try to do something sane which may or may not match
what your system strftime() does. And that continues to be the case
after my patch.

So unless we are going to give the full breakdown of when %Z is empty
and when it is not, I prefer to leave it unspecified.

> > 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.

Thanks for checking.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]