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

log.date 'iso-strict' does not comply with ISO 8601-1:2020-12

From
OIOsipov, Michael (IN IT IN) <michael.osipov@innomotics.com>
Date
Mar 13, 2024, 11:27 UTC
Message-ID
<410d458c-ae5b-40cc-9c8e-97b016c74a76@siemens.com>
Folks,
I am running git version 2.43.0 and consider the following config:
> $ git config --system --list
> core.eol=native
> log.date=iso-strict
> color.ui=auto
when a commit happens with a zero offset the following is displayed:
Show 8 quoted lines
> osipovmi@deblndw011x:~/var/Projekte/tomcat-native ((ba1454e15...)|BISECTING)
> $ git log
> commit ba1454e15619a44fe66d86f59c766c0cc25323eb (HEAD)
> Author: Mark Thomas <markt@apache.org>
> Date:   2024-02-13T08:27:43+00:00
> 
>     Fix link
> 
This not right according to the standard in the original language 
version, namely in sections:
* 4.3.13 Zeitverschiebung (time shift) (roughly translated from German): 
Z denotes that there is no shift from UTC. It also says that you either 
have an offset or use "Z"
* 5.3.3 Uhrzeit in UTC (time in UTC) (roughly translated from German): 
...the formats from sections ... must be used followed by the UTC marker 
"Z" without space.

Throughout the definition neither +0000 for the basic format nor +00:00 for the extended format are used to denote a zero offset from UTC.

The offending code snippet is here: https://github.com/git/git/blob/945115026aa63df4ab849ab14a04da31623abece/date.c#L344-L352

See also Java's Instant class [1] which is based on ISO 8601 as well is Java's SimpleDateFormat XXX [2] which will *always* print "Z" in case of a zero offset.

I'd expect Git to comply with strict since this is why it has been introduced years ago instead of modifying 'iso'.

Regards,
Michael

[1] https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html [2] https://github.com/openjdk/jdk8u-dev/blob/fbb3392d744d1572239eeca082d7365a03897b8b/jdk/src/share/classes/java/text/SimpleDateFormat.java#L1291-L1306

Next: Beat Bolli
Message 1 of 10 in “log.date 'iso-strict' does not comply with ISO 8601-1:2020-12”
  1. Osipov, Michael (IN IT IN)Mar 13, 2024
  2. date: make "iso-strict" conforming for the UTC timezoneBeat Bolli, Mar 13, 2024
  3. Junio C HamanoMar 13, 2024
  4. Osipov, Michael (IN IT IN)Mar 13, 2024
  5. date: make "iso-strict" conforming for the UTC timezoneBeat Bolli, Mar 13, 2024
  6. Junio C HamanoMar 13, 2024
  7. date: make "iso-strict" conforming for the UTC timezoneBeat Bolli, Mar 13, 2024
  8. Junio C HamanoMar 13, 2024
  9. Osipov, Michael (IN IT IN)Mar 13, 2024
  10. Kristoffer HaugsbakkMar 13, 2024

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.