git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: rs/strbuf-addftime-zZ, was Re: What's cooking in git.git (Jun 2017, #04; Tue, 13)

From
René Scharfe <l.s.r@web.de>
Date
Jun 14, 2017, 19:36 UTC
Message-ID
<e9260c40-c49f-d7f6-70c2-a28c1b3104a2@web.de>
In-Reply-To
<20170614111043.xlfsgclbyrqektb3@sigill.intra.peff.net>
Am 14.06.2017 um 13:10 schrieb Jeff King:
Show 25 quoted lines
> On Wed, Jun 14, 2017 at 12:57:06PM +0200, Johannes Schindelin wrote:
>> But even then, it fails in t0006 on Windows with this error:
>>
>> -- snip --
>> ++ eval 'diff -u "$@" '
>> +++ diff -u expect actual
>> --- expect      2017-06-14 10:53:40.126136900 +0000
>> +++ actual      2017-06-14 10:53:40.171146800 +0000
>> @@ -1 +1 @@
>> -1466000000 +0200 -> 2016-06-15 14:13:20 +0000 (UTC)
>> +1466000000 +0200 -> 2016-06-15 14:13:20 UTC (UTC)
> 
> Ugh, I was worried about that some systems might display timezones
> differently (that's why I _didn't_ check %Z in the EST5 case). But I
> must admit this was not an incompatibility I was expecting. It looks
> like your system strftime() turns %z into "UTC". POSIX says:
> 
>    %z
>      Replaced by the offset from UTC in the ISO 8601:2000 standard format
>      (+hhmm or -hhmm), or by no characters if no timezone is
>      determinable.
> 
> So it seems like the mingw strftime is violating POSIX. I don't see an
> easy solution beyond marking this as !MINGW. Though if we wanted a
> partial test, we could test %z and %Z separately.

Hmm. The patches currently either let strftime handle both %z and %Z (in the local case) or handle both internally. Perhaps we need a third option, namely to handle %z internally in all cases for systems whose implementation violates POSIX? Nah, it would be easier to always handle %z internally. Any downsides? Does someone actually expect %z to show time zone names instead of offsets on Windows?

René
Previous: Jeff KingNext: Johannes Schindelin
Message 8 of 13 in “What's cooking in git.git (Jun 2017, #04; Tue, 13)”
  1. Junio C HamanoJun 13, 2017
  2. Jonathan NiederJun 14, 2017
  3. Junio C HamanoJun 15, 2017
  4. Lars SchneiderJun 14, 2017
  5. Torsten BögershausenJun 14, 2017
  6. rs/strbuf-addftime-zZ, was Re: What's cooking in git.git (Jun 2017, #04; Tue, 13)Johannes Schindelin, Jun 14, 2017
  7. Jeff KingJun 14, 2017
  8. René ScharfeJun 14, 2017
  9. Johannes SchindelinJun 14, 2017
  10. René ScharfeJun 14, 2017
  11. Jeff KingJun 15, 2017
  12. René ScharfeJun 15, 2017
  13. Junio C HamanoJun 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.