git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git rev-parse --since=1970-01-01 does not work reliably
@ 2011-10-31 16:17 Dmitry V. Levin
  2011-10-31 23:13 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry V. Levin @ 2011-10-31 16:17 UTC (permalink / raw)
  To: git

Hi,

git rev-parse --since=1970-01-01 (and other git commands that take
date string arguments like --since) may fail when --since=1970-01-01 is
given.  Whether it fails or not depends on current time and timezone data.
For example, "TZ=Europe/Paris git rev-parse --since=1970-01-01" fails two
hours a day (between 00:00 and 02:00 CET), and those who use more eastern
timezones are even less lucky.  In artificial timezones like UTC-24 it
always fails:

$ TZ=UTC-24 git rev-parse --since=1970-01-01
--max-age=18446744073709523490

The problem is that several internal git functions implicitly convert
time_t to unsigned long, so when time_t gets negative, all date string
processing breaks.


-- 
ldv

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

end of thread, other threads:[~2011-11-04  0:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-31 16:17 git rev-parse --since=1970-01-01 does not work reliably Dmitry V. Levin
2011-10-31 23:13 ` Nguyen Thai Ngoc Duy
2011-11-01 12:44   ` Dmitry V. Levin
2011-11-03 12:36     ` Nguyen Thai Ngoc Duy
2011-11-03 23:37   ` Nguyen Thai Ngoc Duy
2011-11-04  0:36     ` Junio C Hamano

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).