{"thread":{"id":"11255","subject":"Invalid dates in git log","startedAt":"2007-12-12T09:11:12Z","lastAt":"2007-12-12T18:57:51Z","messageCount":7,"participants":["Eirik Bjørsnøs","Jeff King","Junio C Hamano","Johannes Schindelin","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"62878","messageId":"34660cca0712120111k3f11769fk1a8cefda3b82683e@mail.gmail.com","threadId":"11255","inReplyTo":null,"subject":"Invalid dates in git log","fromName":"Eirik Bjørsnøs","fromEmail":"eirbjo@gmail.com","sentAt":"2007-12-12T09:11:12Z","receivedAt":"2007-12-12T09:11:12Z","isPatch":false,"sender":{"key":"eirbjo@gmail.com","avatar":"https://gravatar.com/avatar/f4d63d977be4245a00e9cdc15c7f9f3c65c7167a22c667daf4558c3ef5809f5f?d=mp&s=160"},"body":"Hi there,\n\nI'm experiencing a date issue with certain commits in Git in Linus's\n2.6 kernel repository.\n\nOne commit has a date from 2019, while another commit has a date from\n1970. Although Git has been around for a while and seeing a Linux\ncommit from 2019 would be cool, I think there's something wrong here.\n\nMy questions are:\n\n1) Is this a problem in the Git software?\n2) Or is it a data corruption issue in the repository?\n3) Can it be fixed and should I contact anyone to get it fixed?\n\nI'm doing some log analysis and these two dates mess up my charts.\n\nSteps to reproduce:\n\n$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\n\n$ git  log  a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 -1\ncommit a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56\nAuthor: Len Brown <len.brown@intel.com>\nDate:   Fri Apr 5 00:07:45 2019 -0500\n\n    [ACPI] fix merge error that broke CONFIG_ACPI_DEBUG=y build\n\n    Signed-off-by: Len Brown <len.brown@intel.com>\n\n$ git  log  224426f168aa4af3dcb628e6edaa824d32d60e6f  -1\ncommit 224426f168aa4af3dcb628e6edaa824d32d60e6f\nAuthor: Ursula Braun <braunu@de.ibm.com>\nDate:   Thu Jan 1 01:00:01 1970 +0100\n\n    qeth: remove header_ops bug\n\n    Remove qeth bug caused by commit:\n    [NET]: Move hardware header operations out of netdevice.\n\n    Signed-off-by: Ursula Braun <braunu@de.ibm.com>\n    Signed-off-by: Jeff Garzik <jeff@garzik.org>\n\n\nThanks,\n\nEirik.\n"},{"id":"62882","messageId":"20071212092304.GA20799@coredump.intra.peff.net","threadId":"11255","inReplyTo":"34660cca0712120111k3f11769fk1a8cefda3b82683e@mail.gmail.com","subject":"Re: Invalid dates in git log","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-12-12T09:23:04Z","receivedAt":"2007-12-12T09:23:04Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Dec 12, 2007 at 10:11:12AM +0100, Eirik Bjørsnøs wrote:\n\n> My questions are:\n> \n> 1) Is this a problem in the Git software?\n\nNo. Whoever made the commit probably just didn't have their clock set\nright. Git doesn't generally care about the timestamp for its\noperations; it just records it as a historical note.\n\n> 2) Or is it a data corruption issue in the repository?\n\nNo. You can check for corruption with git-fsck, but these commits were\nactually created with bad dates.\n\n> 3) Can it be fixed and should I contact anyone to get it fixed?\n\nChanging the date will change the commit id (since the id is the sha1 of\nthe commit contents). Which would mean rewriting all of the history that\nfollows it. You could do it in your own repository, but then you might\nhave some trouble merging with Linus later on. Linus could do it, but I\ndoubt he will think it is worth the trouble.\n\n> $ git  log  a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 -1\n> commit a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56\n> Author: Len Brown <len.brown@intel.com>\n> Date:   Fri Apr 5 00:07:45 2019 -0500\n\nYour best guess is probably the committer information. Try this:\n\n  git log a27ac38 -1 --pretty=format:'Author: %an %ad%nCommitter: %cn %cd'\n\n-Peff\n"},{"id":"62884","messageId":"7vejds8ddf.fsf@gitster.siamese.dyndns.org","threadId":"11255","inReplyTo":"20071212092304.GA20799@coredump.intra.peff.net","subject":"Re: Invalid dates in git log","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-12T09:35:08Z","receivedAt":"2007-12-12T09:35:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Dec 12, 2007 at 10:11:12AM +0100, Eirik Bjørsnøs wrote:\n>\n>> My questions are:\n>> \n>> 1) Is this a problem in the Git software?\n>\n> No. Whoever made the commit probably just didn't have their clock set\n> right. Git doesn't generally care about the timestamp for its\n> operations; it just records it as a historical note.\n\n\"git show -s\" with --pretty=fuller and --pretty=raw on these two\ncommiits reveal:\n\n    Author:     Ursula Braun <braunu@de.ibm.com>\n    AuthorDate: Thu Jan 1 01:00:01 1970 +0100\n    Commit:     Jeff Garzik <jeff@garzik.org>\n    CommitDate: Fri Oct 19 23:00:02 2007 -0400\n\n    author Ursula Braun <braunu@de.ibm.com> 1 +0100\n    committer Jeff Garzik <jeff@garzik.org> 1192849202 -0400\n\n    Author:     Len Brown <len.brown@intel.com>\n    AuthorDate: Fri Apr 5 00:07:45 2019 -0500\n    Commit:     Len Brown <len.brown@intel.com>\n    CommitDate: Tue Jul 12 00:12:09 2005 -0400\n\n    author Len Brown <len.brown@intel.com> 1554440865 -0500\n    committer Len Brown <len.brown@intel.com> 1121141529 -0400\n\nSo the former commit was made while seting GIT_AUTHOR_DATE explicitly to\n1, which is quite likely a bug in some script Jeff used to create this\ncommit about two months ago.\n\nI have no idea about the latter, though.  It looks like quite a random\ntimestamp, and committer timestamp look reasonable, relative to the\nother commits around it.\n\nFor a short while, between Nov 11th to Dec 8th this year on 'next' (and\nbetween Dec 4th and Dec 8th on 'master'), git-commit-tree accepted an\nempty GIT_AUTHOR_DATE and recorded a bogus \"0\" time in the commit by\nmistake, but such a commit would have shown something like:\n\n    author A U Thor <au.thor@example.com>\n\nwithout any timestamp, and both commits predate the gotcha, so I do not\nthink they are caused by that recent breakage.\n"},{"id":"62899","messageId":"34660cca0712120619r708ee7a8ta20a5458ca11a5ac@mail.gmail.com","threadId":"11255","inReplyTo":"20071212092304.GA20799@coredump.intra.peff.net","subject":"Re: Invalid dates in git log","fromName":"Eirik Bjørsnøs","fromEmail":"eirbjo@gmail.com","sentAt":"2007-12-12T14:19:49Z","receivedAt":"2007-12-12T14:19:49Z","isPatch":false,"sender":{"key":"eirbjo@gmail.com","avatar":"https://gravatar.com/avatar/f4d63d977be4245a00e9cdc15c7f9f3c65c7167a22c667daf4558c3ef5809f5f?d=mp&s=160"},"body":"> Your best guess is probably the committer information. Try this:\n\nThanks Jeff, Junio,\n\nI'll just use the committer date instead.\n\nBeing a Git newbie (only started looking at it yesterday) I'm not sure\nmy understanding of \"author\" and \"committer\" and how they releate to\ndates is correct:\n\n* author: Original source of the change. This person may typically\nhave sent a committer an email with a patch. It's the commiter's\nresponsibility to supply this information.\n* author date: The commiter is free to specify a date for the contribution.\n\n* committer: First committer to actually add this change to a repository\n* committer date: Date of the actual commit, added by the git client\nduring the commit. Typically the system clock at the time of the\ncommit.\n\n* A transfer of a commit across repositories (pull, push) will not\nchange the author, commit or date information\n\nIf I got some of this wrong, I'd be happy if someone would correct me.\n\nThanks,\n\nEirik.\n"},{"id":"62904","messageId":"Pine.LNX.4.64.0712121457280.27959@racer.site","threadId":"11255","inReplyTo":"7vejds8ddf.fsf@gitster.siamese.dyndns.org","subject":"Re: Invalid dates in git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-12T14:59:31Z","receivedAt":"2007-12-12T14:59:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 12 Dec 2007, Junio C Hamano wrote:\n\n>     Author:     Len Brown <len.brown@intel.com>\n>     AuthorDate: Fri Apr 5 00:07:45 2019 -0500\n>     Commit:     Len Brown <len.brown@intel.com>\n>     CommitDate: Tue Jul 12 00:12:09 2005 -0400\n> \n>     author Len Brown <len.brown@intel.com> 1554440865 -0500\n>     committer Len Brown <len.brown@intel.com> 1121141529 -0400\n> \n> [...] It looks like quite a random timestamp, and committer timestamp \n> look reasonable, relative to the other commits around it.\n\nIt is quite possible that Len Brown had a similar problem to what I \nexperienced yesterday: my clock was set one hour and 22 years into the \nfuture, but I have no idea how that happened.  My only guess is a \nhalf-succeeded ntpdate call, but somehow I doubt that.\n\nCiao,\nDscho\n"},{"id":"62918","messageId":"47600392.5050809@op5.se","threadId":"11255","inReplyTo":"34660cca0712120619r708ee7a8ta20a5458ca11a5ac@mail.gmail.com","subject":"Re: Invalid dates in git log","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-12-12T15:51:46Z","receivedAt":"2007-12-12T15:51:46Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Eirik Bjørsnøs wrote:\n>> Your best guess is probably the committer information. Try this:\n> \n> Thanks Jeff, Junio,\n> \n> I'll just use the committer date instead.\n> \n> Being a Git newbie (only started looking at it yesterday) I'm not sure\n> my understanding of \"author\" and \"committer\" and how they releate to\n> dates is correct:\n> \n\nThey're often the same. They will end up being different if\n* you cherry-pick a commit made by someone else.\n   (\"someone else\" is author, you are the committer)\n* you rebase a series of commit containing changes from others\n   (\"others\" are the authors, you are the committer)\n* you apply a patch using \"git am\" from someone\n   (\"someone\" is the author, you are the committer)\n* you \"git commit --amend\" a commit from someone else\n   (\"someone else\" is author, you are the committer)\n\nThere are probably other cases, but those were the ones I could\nthink of right now.\n\nIn short, whenever a commit is modified in some way, it gets a\nnew committer. It might help if you think of author as \"contributor\"\nand \"committer\" as \"integrator\", where various integrators merge\nbetween each other. A merge obviously doesn't fiddle with commits,\nso once a commit has entered an integrators repository, both author\nand committer stays intact (that's not strictly true, but for the\nsake of this argument, which concerns the linux kernel, it will\nsuffice and be mostly correct insofar as I understand the kernel\nworkflow).\n\n> * author: Original source of the change. This person may typically\n> have sent a committer an email with a patch. It's the commiter's\n> responsibility to supply this information.\n\nNo, it's the author's responsibility to supply this information.\nAuthor is hardly ever changed.\n\n> * author date: The commiter is free to specify a date for the contribution.\n> \n\nNo, the author does that too :)\n\n> * committer: First committer to actually add this change to a repository\n\nNo, committer is the person who added the commit to the repository by\nsome other means than merging from another repository.\n\n> * committer date: Date of the actual commit, added by the git client\n> during the commit. Typically the system clock at the time of the\n> commit.\n> \n\nSort of, yes, although commits can be created by other means than\njust running \"git commit\". The operations listed in bullets at the\ntop of this mail all create new commits, in the sense that they\ncan't have the same SHA1 as their original ones. Hence, committer\nand commitdate must be updated.\n\n> * A transfer of a commit across repositories (pull, push) will not\n> change the author, commit or date information\n> \n\nTrue. Since neither ancestry nor content is allowed to change, the\ncommit will be exactly the same in the new repository as it was in\nthe old one.\n\n> If I got some of this wrong, I'd be happy if someone would correct me.\n> \n\nI think I just did. Perhaps I missed something, but I'm sure someone\nwill correct me if that's the case.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"62949","messageId":"7v8x3z91w0.fsf@gitster.siamese.dyndns.org","threadId":"11255","inReplyTo":"Pine.LNX.4.64.0712121457280.27959@racer.site","subject":"Re: Invalid dates in git log","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-12T18:57:51Z","receivedAt":"2007-12-12T18:57:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Wed, 12 Dec 2007, Junio C Hamano wrote:\n>\n>>     Author:     Len Brown <len.brown@intel.com>\n>>     AuthorDate: Fri Apr 5 00:07:45 2019 -0500\n>>     Commit:     Len Brown <len.brown@intel.com>\n>>     CommitDate: Tue Jul 12 00:12:09 2005 -0400\n>> \n>>     author Len Brown <len.brown@intel.com> 1554440865 -0500\n>>     committer Len Brown <len.brown@intel.com> 1121141529 -0400\n>> \n>> [...] It looks like quite a random timestamp, and committer timestamp \n>> look reasonable, relative to the other commits around it.\n>\n> It is quite possible that Len Brown had a similar problem to what I \n> experienced yesterday: my clock was set one hour and 22 years into the \n> future, but I have no idea how that happened.  My only guess is a \n> half-succeeded ntpdate call, but somehow I doubt that.\n\nBut how would you explain the more reasonable committer date?\n\nI am guessing that this particular commit was rebased (using rebase,\nrebase -i, stgit, guilt or something else), and whatever tool that was\nused had some thinko that broke the author timestamp (and zone).\n\nNah, exonerate guilt and rebase -i from the list.  The commit is from\nJuly 2005 which means there wasn't much usable tool for rebasing in the\ncore distribution.  Interactive rebase did not exist back then, and\nrebase was done with \"git-commit-script -m\", which took an existing\ncommit and used its metainformation when creating a commit.  This was\nalmost totally different codepath from what we have now.  Not even\nformat-patch nor applymbox existed.\n\nStGIT 0.4 (initial) was Jul 10, 2005, so it is _possible_ (I do not know\nabout plausibility) that it had an early bug that caused this, but if we\nreally want to figure it out we need to ask Len what was used, and I\nsuspect the most likely answer is \"are you crazy enough to expect me to\nremember?\".\n\nI am personally more interested in the other one, which was much more\nrecent incident, though.\n"}]}