Git development
 help / color / mirror / Atom feed
* [BUG] internal date format does not accept small unix timestamps
@ 2026-05-29 11:51 Luna Schwalbe
  2026-05-29 12:50 ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 6+ messages in thread
From: Luna Schwalbe @ 2026-05-29 11:51 UTC (permalink / raw)
  To: git

While trying to create some test commits, I noticed the following issue:

GIT_AUTHOR_DATE and GIT_COMMITTER_DATE should accept the "Git internal 
format" (displayed by git log with --date=raw), but this fails for small 
unix timestamps. A quick binary search indicates that it happens when 
the unix timestamp is below 100000000 (9 digits).

So for example, GIT_AUTHOR_DATE='99999999 +0000' fails with "fatal: 
invalid date format", while GIT_AUTHOR_DATE='100000000 +0000' works as 
expected.
It seems to be unaffected by the choice of timezone offset.
Padding the timestamp with zeroes also does not change the behavior.

The --date option does accept all the values, but interprets them 
wrongly and gives bogus results (most of them time it seems to act as if 
no date option was given, using the current system time, but with some 
inputs I've also observed things like "current date&time but set the 
year to 2000").

I tested everything with git built from commit 
2f8565e1d14d2de4cfbc9da0132131bf0d0dc087.

Luna

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

end of thread, other threads:[~2026-05-31  8:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-29 11:51 [BUG] internal date format does not accept small unix timestamps Luna Schwalbe
2026-05-29 12:50 ` Kristoffer Haugsbakk
2026-05-29 14:52   ` Luna Schwalbe
2026-05-29 22:52     ` Junio C Hamano
2026-05-30  7:43       ` doc: document '@' prefix for raw timestamps Junio C Hamano
2026-05-31  8:29         ` Luna Schwalbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox