git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Mishandling of fractional seconds in ISO 8601 format
@ 2020-04-14  0:03 brian m. carlson
  2020-04-14  9:31 ` [PATCH 0/2] More ISO-8601 support Đoàn Trần Công Danh
  0 siblings, 1 reply; 49+ messages in thread
From: brian m. carlson @ 2020-04-14  0:03 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]

git-commit(1) claims we support ISO 8601 format.  However, our
approxidate code misparses some dates with fractional seconds.

Reproduction:

  git init foo
  cd foo
  echo abc > abc.txt
  git add .
  git commit --date="2020-04-03T12:43:55.019-04:00”

This should produce Fri Apr 3 12:43:55 2020 -0400, but actually produces
Sun Apr 19 12:43:55 2020 +0000 (at least on my system, which uses UTC).
Note the different date, which is 16 days away from what is expected.

Since we claim to support ISO 8601, we need to either reject fractional
seconds with an error, or accept and ignore them.  If what we really
support is RFC 3339 (which I suspect it is), we need to do the latter,
since that profile explicitly permits them in the syntax, as well as
update the documentation accordingly.

This was originally reported at
https://stackoverflow.com/questions/61193896/how-does-git-parse-date-string/61197722.
I don't plan to send a patch for this right now, but I wanted to make
sure it was reported to the list.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

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

end of thread, other threads:[~2020-04-24 20:33 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14  0:03 Mishandling of fractional seconds in ISO 8601 format brian m. carlson
2020-04-14  9:31 ` [PATCH 0/2] More ISO-8601 support Đoàn Trần Công Danh
2020-04-14  9:31   ` [PATCH 1/2] date.c: allow fractional second part of ISO-8601 Đoàn Trần Công Danh
2020-04-14 20:16     ` Jeff King
2020-04-15  2:15       ` Danh Doan
2020-04-14 20:17     ` Jeff King
2020-04-14 23:49       ` brian m. carlson
2020-04-15  2:17         ` Danh Doan
2020-04-14  9:31   ` [PATCH 2/2] date.c: allow compact version of ISO-8601 datetime Đoàn Trần Công Danh
2020-04-14 20:24     ` Jeff King
2020-04-15  2:12       ` Danh Doan
2020-04-15 15:03       ` Junio C Hamano
2020-04-15 15:41         ` Jeff King
2020-04-15 15:58           ` Junio C Hamano
2020-04-16 11:16           ` Danh Doan
2020-04-14 23:45   ` [PATCH 0/2] More ISO-8601 support brian m. carlson
2020-04-15  3:31   ` [PATCH v2 " Đoàn Trần Công Danh
2020-04-15  3:31     ` [PATCH v2 1/2] date.c: skip fractional second part of ISO-8601 Đoàn Trần Công Danh
2020-04-15 10:17       ` Torsten Bögershausen
2020-04-16 10:04         ` Danh Doan
2020-04-15  3:31     ` [PATCH v2 2/2] date.c: allow compact version of ISO-8601 datetime Đoàn Trần Công Danh
2020-04-22 13:15   ` [PATCH v3 0/2] More ISO-8601 support Đoàn Trần Công Danh
2020-04-22 13:15     ` [PATCH v3 1/2] date.c: skip fractional second part of ISO-8601 Đoàn Trần Công Danh
2020-04-22 17:05       ` Junio C Hamano
2020-04-23  1:18         ` Danh Doan
2020-04-23 19:28           ` Junio C Hamano
2020-04-23 20:41             ` Philip Oakley
2020-04-24  0:07               ` Danh Doan
2020-04-24  0:46                 ` Junio C Hamano
2020-04-24 17:32                   ` Philip Oakley
2020-04-24 17:30                 ` Philip Oakley
2020-04-22 13:15     ` [PATCH v3 2/2] date.c: allow compact version of ISO-8601 datetime Đoàn Trần Công Danh
2020-04-22 17:17       ` Junio C Hamano
2020-04-23  1:20         ` Danh Doan
2020-04-23 13:52   ` [PATCH v4 0/4] More ISO-8601 support Đoàn Trần Công Danh
2020-04-23 13:52     ` [PATCH v4 1/4] date.c: s/is_date/set_date/ Đoàn Trần Công Danh
2020-04-23 20:08       ` Junio C Hamano
2020-04-23 13:52     ` [PATCH v4 2/4] date.c: validate and set time in a helper function Đoàn Trần Công Danh
2020-04-23 20:18       ` Junio C Hamano
2020-04-24 11:43         ` Danh Doan
2020-04-24 20:29           ` Junio C Hamano
2020-04-23 13:52     ` [PATCH v4 3/4] date.c: skip fractional second part of ISO-8601 Đoàn Trần Công Danh
2020-04-23 20:29       ` Junio C Hamano
2020-04-23 13:52     ` [PATCH v4 4/4] date.c: allow compact version of ISO-8601 datetime Đoàn Trần Công Danh
2020-04-24 15:07   ` [PATCH v5 0/4] More ISO-8601 support Đoàn Trần Công Danh
2020-04-24 15:07     ` [PATCH v5 1/4] date.c: s/is_date/set_date/ Đoàn Trần Công Danh
2020-04-24 15:07     ` [PATCH v5 2/4] date.c: validate and set time in a helper function Đoàn Trần Công Danh
2020-04-24 15:07     ` [PATCH v5 3/4] date.c: skip fractional second part of ISO-8601 Đoàn Trần Công Danh
2020-04-24 15:07     ` [PATCH v5 4/4] date.c: allow compact version of ISO-8601 datetime Đoàn Trần Công Danh

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).