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

Re: git rev-parse --since=1970-01-01 does not work reliably

From
Dmitry V. Levin <ldv@altlinux.org>
Date
Nov 1, 2011, 12:44 UTC
Message-ID
<20111101124434.GB22229@altlinux.org>
In-Reply-To
<20111031231320.GA3857@do>
On Tue, Nov 01, 2011 at 06:13:20AM +0700, Nguyen Thai Ngoc Duy wrote:
Show 15 quoted lines
> On Mon, Oct 31, 2011 at 08:17:09PM +0400, Dmitry V. Levin wrote:
> > 
> > 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
> 
> Out of curiosity, why do you need to work with a time so close to that
> date?

There is an utility that used to invoke "git log --since='1970-01-01 UTC'" by default, and I was unlucky enough to use it during these hours of failure. The utility is now fixed (it no longer calls git log with --since option unless explicitly instructed to do so), and I hope git is going to be fixed as well.

BTW, the timezone specifier (UTC) in "git rev-parse --since='1970-01-01 UTC'" seems to be completely ignored by date string parser.

-- 
ldv
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 3 of 6 in “git rev-parse --since=1970-01-01 does not work reliably”
  1. Dmitry V. LevinOct 31, 2011
  2. Nguyen Thai Ngoc DuyOct 31, 2011
  3. Dmitry V. LevinNov 1, 2011
  4. Nguyen Thai Ngoc DuyNov 3, 2011
  5. Nguyen Thai Ngoc DuyNov 3, 2011
  6. Junio C HamanoNov 4, 2011

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.