git-2.13.0: log --date=format:%z not working

2017-05-26 Thread Ulrich Mueller
The following commands work as expected (using commit b06d364310 in the git://git.kernel.org/pub/scm/git/git.git repo as test case): $ export TZ=Europe/Berlin $ git --no-pager log -1 --pretty="%ad" --date=iso b06d364310 2017-05-09 23:26:02 +0900 $ git --no-pager log -1 --pretty="%ad" --date=iso-lo

Re: git-2.13.0: log --date=format:%z not working

2017-05-27 Thread Ævar Arnfjörð Bjarmason
On Fri, May 26, 2017 at 8:33 PM, Ulrich Mueller wrote: > The following commands work as expected (using commit b06d364310 > in the git://git.kernel.org/pub/scm/git/git.git repo as test case): > > $ export TZ=Europe/Berlin > $ git --no-pager log -1 --pretty="%ad" --date=iso b06d364310 > 2017-05-09

Re: git-2.13.0: log --date=format:%z not working

2017-05-27 Thread Jeff King
On Sat, May 27, 2017 at 06:57:08PM +0200, Ævar Arnfjörð Bjarmason wrote: > There's another test which breaks if we just s/gmtime/localtime/g. As > far as I can tell to make the non-local case work we'd need to do a > whole dance where we set the TZ variable to e.g. UTC$offset, then call > strftime

Re: git-2.13.0: log --date=format:%z not working

2017-05-28 Thread Ævar Arnfjörð Bjarmason
On Sat, May 27, 2017 at 11:46 PM, Jeff King wrote: > On Sat, May 27, 2017 at 06:57:08PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> There's another test which breaks if we just s/gmtime/localtime/g. As >> far as I can tell to make the non-local case work we'd need to do a >> whole dance where we se

Re: git-2.13.0: log --date=format:%z not working

2017-05-28 Thread René Scharfe
Am 27.05.2017 um 23:46 schrieb Jeff King: > On Sat, May 27, 2017 at 06:57:08PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> There's another test which breaks if we just s/gmtime/localtime/g. As >> far as I can tell to make the non-local case work we'd need to do a >> whole dance where we set the TZ

Re: git-2.13.0: log --date=format:%z not working

2017-05-28 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: >> >> Here are some links to past explorations: >> >> http://public-inbox.org/git/20160208152858.ga17...@sigill.intra.peff.net/ >> >> http://public-inbox.org/git/87vb2d37ea@web.de/ > > There's a third and possibly least shitty option that isn't covered in >

Re: git-2.13.0: log --date=format:%z not working

2017-06-01 Thread Junio C Hamano
René Scharfe writes: > Am 27.05.2017 um 23:46 schrieb Jeff King: >> On Sat, May 27, 2017 at 06:57:08PM +0200, Ævar Arnfjörð Bjarmason wrote: >> >>> There's another test which breaks if we just s/gmtime/localtime/g. As >>> far as I can tell to make the non-local case work we'd need to do a >>> wh

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread René Scharfe
Am 02.06.2017 um 05:08 schrieb Jeff King: In theory the solution is: 1. Start using localtime() instead of gmtime() with an adjustment when we are converting to the local timezone (i.e., format-local). We should be able to do this portably. This is easy to do, and it's bett

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread Jeff King
On Fri, Jun 02, 2017 at 07:25:43PM +0200, René Scharfe wrote: > Am 02.06.2017 um 05:08 schrieb Jeff King: > > In theory the solution is: > > > >1. Start using localtime() instead of gmtime() with an adjustment when > > we are converting to the local timezone (i.e., format-local). We > >

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread Jeff King
On Fri, Jun 02, 2017 at 11:23:30AM +0900, Junio C Hamano wrote: > René Scharfe writes: > > > Am 27.05.2017 um 23:46 schrieb Jeff King: > >> On Sat, May 27, 2017 at 06:57:08PM +0200, Ævar Arnfjörð Bjarmason wrote: > >> > >>> There's another test which breaks if we just s/gmtime/localtime/g. As >

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread Ulrich Mueller
> On Fri, 2 Jun 2017, Jeff King wrote: > On Fri, Jun 02, 2017 at 07:25:43PM +0200, René Scharfe wrote: >> On Linux "%z %Z" is expanded to "+0200 CEST" for me, while on Windows I >> get "Mitteleurop▒ische Sommerzeit Mitteleurop▒ische Sommerzeit". (That >> "▒" is probably supposed to be an "ä".

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread Jeff King
On Sat, Jun 03, 2017 at 12:04:32AM +0200, Ulrich Mueller wrote: > Actually, the POSIX definition for %Z continues: "or by no bytes if no > timezone information exists." So also returning an empty string would > be compliant (but maybe not very helpful). > [...] > I agree that GMT+0200 could be mis

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread Ulrich Mueller
> On Fri, 2 Jun 2017, Jeff King wrote: > The remaining question is whether we want to care about preserving the > system %Z for the local-timezone case. No strong preference here. Maybe go for consistency, and have %Z always return the same format (either empty, or same as %z). That would at

Re: git-2.13.0: log --date=format:%z not working

2017-06-02 Thread Jeff King
On Sat, Jun 03, 2017 at 12:47:59AM +0200, Ulrich Mueller wrote: > > On Fri, 2 Jun 2017, Jeff King wrote: > > > The remaining question is whether we want to care about preserving the > > system %Z for the local-timezone case. > > No strong preference here. Maybe go for consistency, and have %