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

Re: Odd broken "--date=now" behavior in current git

From
Peter Krefting <peter@softwolves.pp.se>
Date
Apr 15, 2015, 07:07 UTC
Message-ID
<alpine.DEB.2.00.1504150803370.8606@ds9.cixit.se>
In-Reply-To
<CA+55aFxvcN8Dz-t6fi6etycg+AiyR0crXv5AcfCdv8ji-iNBpw@mail.gmail.com>
Linus Torvalds:
> I can't be the only one seeing this? My guess is that there's a 
> missing initialization of tm.tm_isdst somewhere or whatever.

I can confirm it if I enable DST on my machine (I usually run my machines on CET all-year, to avoid these kind of issues):

   $ echo $TZ
   Europe/Oslo
   $ git commit -m b
   [master dee7ec1] b
    1 file changed, 1 insertion(+)
    create mode 100644 b.txt
   $ git show --pretty=fuller
   commit dee7ec1cda74a8abd7f26c60ee1e83f73bb31194 (HEAD -> master)
   Author:     Peter Krefting <peter.krefting@bridgetech.tv>
   AuthorDate: 2015-04-15 09:04:34 +0200
   Commit:     Peter Krefting <peter.krefting@bridgetech.tv>
   CommitDate: 2015-04-15 09:04:34 +0200
   [...]
   $ git commit --amend --date=now
   [...]
   $ git show --pretty=fuller
   commit b4561e5a077de7bbcaf9fc06350ea24407adcec0 (HEAD -> master)
   Author:     Peter Krefting <peter.krefting@bridgetech.tv>
   AuthorDate: 2015-04-15 08:05:04 +0100
   Commit:     Peter Krefting <peter.krefting@bridgetech.tv>
   CommitDate: 2015-04-15 09:05:04 +0200

So the datetime is correct, it's just the timezone that is wrong (08:05+0100 = 09:05+0200).

   $ git --version
   git version 2.4.0.rc1
-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Junio C Hamano
Message 10 of 10 in “Odd broken "--date=now" behavior in current git”
  1. Linus TorvaldsApr 15, 2015
  2. Junio C HamanoApr 15, 2015
  3. Eric SunshineApr 15, 2015
  4. Junio C HamanoApr 15, 2015
  5. 1/2 parse_date_basic(): return early when given a bogus timestampJunio C Hamano, Apr 15, 2015
  6. 2/2 parse_date_basic(): let the system handle DST conversionJunio C Hamano, Apr 15, 2015
  7. Eric SunshineApr 15, 2015
  8. Linus TorvaldsApr 15, 2015
  9. Junio C HamanoApr 15, 2015
  10. Peter KreftingApr 15, 2015

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.