Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

[BUG] minor: wrong handling of GIT_AUTHOR_DATE

From: Hermann Gausterer <hidden>
Date: 2016-06-15 22:45:10

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 [off-list ref]
Date:   Thu Aug 1 01:52:04 1985 +0200

    test
$

mfg hermann

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help