git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* log.date 'iso-strict' does not comply with ISO 8601-1:2020-12
@ 2024-03-13 11:27 Osipov, Michael (IN IT IN)
  2024-03-13 17:50 ` [PATCH] date: make "iso-strict" conforming for the UTC timezone Beat Bolli
  0 siblings, 1 reply; 10+ messages in thread
From: Osipov, Michael (IN IT IN) @ 2024-03-13 11:27 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-03-13 23:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 11:27 log.date 'iso-strict' does not comply with ISO 8601-1:2020-12 Osipov, Michael (IN IT IN)
2024-03-13 17:50 ` [PATCH] date: make "iso-strict" conforming for the UTC timezone Beat Bolli
2024-03-13 18:30   ` Junio C Hamano
2024-03-13 19:29     ` Osipov, Michael (IN IT IN)
2024-03-13 22:29     ` [PATCH v2] " Beat Bolli
2024-03-13 22:42       ` Junio C Hamano
2024-03-13 22:54         ` [PATCH v3] " Beat Bolli
2024-03-13 23:06           ` Junio C Hamano
2024-03-13 19:27   ` [PATCH] " Osipov, Michael (IN IT IN)
2024-03-13 20:09   ` Kristoffer Haugsbakk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).