Git development
 help / color / mirror / Atom feed
* [BUG] minor: wrong handling of GIT_AUTHOR_DATE
@ 2008-08-16 20:53 Hermann Gausterer
  2008-08-16 23:03 ` Linus Torvalds
  0 siblings, 1 reply; 10+ messages in thread
From: Hermann Gausterer @ 2008-08-16 20:53 UTC (permalink / raw)
  To: Git Mailinglist; +Cc: Hermann Gausterer

[-- Attachment #1: Type: text/plain, Size: 960 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-08-17 16:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-16 20:53 [BUG] minor: wrong handling of GIT_AUTHOR_DATE Hermann Gausterer
2008-08-16 23:03 ` Linus Torvalds
2008-08-16 23:17   ` Linus Torvalds
2008-08-17  2:46     ` Junio C Hamano
2008-08-17  3:13       ` Junio C Hamano
2008-08-17  4:25         ` Linus Torvalds
2008-08-17  4:37           ` Linus Torvalds
2008-08-17  5:27           ` Junio C Hamano
2008-08-17 16:07             ` Linus Torvalds
2008-08-17  3:50       ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox