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

[BUG] minor: wrong handling of GIT_AUTHOR_DATE

From
HGHermann Gausterer <git-mailinglist@mrq1.org>
Date
Aug 16, 2008, 20:53 UTC
Message-ID
<20080816205325.GD10729@mrq1.org>
hi

i found a minor bug in the handling of the environment variable GIT_AUTHOR_DATE

i used this variable to import an old project.

i used "stat" to get the timestamp of a file and set the git history to this date with this command:

GIT_AUTHOR_DATE=`stat -c '%y' "$FILE"`

old files (created with an older kernel) produced this output.

2008-05-28 14:21:35.000000000 +0200

but new files return nanosecond resolution timestamps.

2008-06-04 17:25:54.917476713 +0200

of course this resolution is NOT needed for git, but git DOES NOT ignore this time- stamps. it changes the date to something completly wrong :-/

steps to reproduce:
$ git init
$ touch test
$ stat -c %y test
2008-08-16 22:25:45.491701924 +0200
$ export GIT_AUTHOR_DATE=`stat -c %y test`
$ git add test
$ git commit -a
$ git log
commit 56f92b8f6efc7bdaa5abdf03a8c5dbf79dd1fdff
Author: Hermann Gausterer <git-bugreport@mrq1.org>
Date:   Thu Aug 1 01:52:04 1985 +0200
    test
$
mfg hermann
Next: Linus Torvalds
Message 1 of 10 in “[BUG] minor: wrong handling of GIT_AUTHOR_DATE”
  1. Hermann GaustererAug 16, 2008
  2. Linus TorvaldsAug 16, 2008
  3. Linus TorvaldsAug 16, 2008
  4. Junio C HamanoAug 17, 2008
  5. Junio C HamanoAug 17, 2008
  6. Linus TorvaldsAug 17, 2008
  7. Linus TorvaldsAug 17, 2008
  8. Junio C HamanoAug 17, 2008
  9. Linus TorvaldsAug 17, 2008
  10. Linus TorvaldsAug 17, 2008

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.