* Invalid dates in git log @ 2007-12-12 9:11 Eirik Bjørsnøs 2007-12-12 9:23 ` Jeff King 0 siblings, 1 reply; 7+ messages in thread From: Eirik Bjørsnøs @ 2007-12-12 9:11 UTC (permalink / raw) To: git Hi there, I'm experiencing a date issue with certain commits in Git in Linus's 2.6 kernel repository. One commit has a date from 2019, while another commit has a date from 1970. Although Git has been around for a while and seeing a Linux commit from 2019 would be cool, I think there's something wrong here. My questions are: 1) Is this a problem in the Git software? 2) Or is it a data corruption issue in the repository? 3) Can it be fixed and should I contact anyone to get it fixed? I'm doing some log analysis and these two dates mess up my charts. Steps to reproduce: $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git $ git log a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 -1 commit a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 Author: Len Brown <len.brown@intel.com> Date: Fri Apr 5 00:07:45 2019 -0500 [ACPI] fix merge error that broke CONFIG_ACPI_DEBUG=y build Signed-off-by: Len Brown <len.brown@intel.com> $ git log 224426f168aa4af3dcb628e6edaa824d32d60e6f -1 commit 224426f168aa4af3dcb628e6edaa824d32d60e6f Author: Ursula Braun <braunu@de.ibm.com> Date: Thu Jan 1 01:00:01 1970 +0100 qeth: remove header_ops bug Remove qeth bug caused by commit: [NET]: Move hardware header operations out of netdevice. Signed-off-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org> Thanks, Eirik. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Invalid dates in git log 2007-12-12 9:11 Invalid dates in git log Eirik Bjørsnøs @ 2007-12-12 9:23 ` Jeff King 2007-12-12 9:35 ` Junio C Hamano 2007-12-12 14:19 ` Eirik Bjørsnøs 0 siblings, 2 replies; 7+ messages in thread From: Jeff King @ 2007-12-12 9:23 UTC (permalink / raw) To: Eirik Bjørsnøs; +Cc: git On Wed, Dec 12, 2007 at 10:11:12AM +0100, Eirik Bjørsnøs wrote: > My questions are: > > 1) Is this a problem in the Git software? No. Whoever made the commit probably just didn't have their clock set right. Git doesn't generally care about the timestamp for its operations; it just records it as a historical note. > 2) Or is it a data corruption issue in the repository? No. You can check for corruption with git-fsck, but these commits were actually created with bad dates. > 3) Can it be fixed and should I contact anyone to get it fixed? Changing the date will change the commit id (since the id is the sha1 of the commit contents). Which would mean rewriting all of the history that follows it. You could do it in your own repository, but then you might have some trouble merging with Linus later on. Linus could do it, but I doubt he will think it is worth the trouble. > $ git log a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 -1 > commit a27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 > Author: Len Brown <len.brown@intel.com> > Date: Fri Apr 5 00:07:45 2019 -0500 Your best guess is probably the committer information. Try this: git log a27ac38 -1 --pretty=format:'Author: %an %ad%nCommitter: %cn %cd' -Peff ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Invalid dates in git log 2007-12-12 9:23 ` Jeff King @ 2007-12-12 9:35 ` Junio C Hamano 2007-12-12 14:59 ` Johannes Schindelin 2007-12-12 14:19 ` Eirik Bjørsnøs 1 sibling, 1 reply; 7+ messages in thread From: Junio C Hamano @ 2007-12-12 9:35 UTC (permalink / raw) To: Jeff King; +Cc: Eirik Bjørsnøs, git Jeff King <peff@peff.net> writes: > On Wed, Dec 12, 2007 at 10:11:12AM +0100, Eirik Bjørsnøs wrote: > >> My questions are: >> >> 1) Is this a problem in the Git software? > > No. Whoever made the commit probably just didn't have their clock set > right. Git doesn't generally care about the timestamp for its > operations; it just records it as a historical note. "git show -s" with --pretty=fuller and --pretty=raw on these two commiits reveal: Author: Ursula Braun <braunu@de.ibm.com> AuthorDate: Thu Jan 1 01:00:01 1970 +0100 Commit: Jeff Garzik <jeff@garzik.org> CommitDate: Fri Oct 19 23:00:02 2007 -0400 author Ursula Braun <braunu@de.ibm.com> 1 +0100 committer Jeff Garzik <jeff@garzik.org> 1192849202 -0400 Author: Len Brown <len.brown@intel.com> AuthorDate: Fri Apr 5 00:07:45 2019 -0500 Commit: Len Brown <len.brown@intel.com> CommitDate: Tue Jul 12 00:12:09 2005 -0400 author Len Brown <len.brown@intel.com> 1554440865 -0500 committer Len Brown <len.brown@intel.com> 1121141529 -0400 So the former commit was made while seting GIT_AUTHOR_DATE explicitly to 1, which is quite likely a bug in some script Jeff used to create this commit about two months ago. I have no idea about the latter, though. It looks like quite a random timestamp, and committer timestamp look reasonable, relative to the other commits around it. For a short while, between Nov 11th to Dec 8th this year on 'next' (and between Dec 4th and Dec 8th on 'master'), git-commit-tree accepted an empty GIT_AUTHOR_DATE and recorded a bogus "0" time in the commit by mistake, but such a commit would have shown something like: author A U Thor <au.thor@example.com> without any timestamp, and both commits predate the gotcha, so I do not think they are caused by that recent breakage. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Invalid dates in git log 2007-12-12 9:35 ` Junio C Hamano @ 2007-12-12 14:59 ` Johannes Schindelin 2007-12-12 18:57 ` Junio C Hamano 0 siblings, 1 reply; 7+ messages in thread From: Johannes Schindelin @ 2007-12-12 14:59 UTC (permalink / raw) To: Junio C Hamano; +Cc: Jeff King, Eirik Bjørsnøs, git Hi, On Wed, 12 Dec 2007, Junio C Hamano wrote: > Author: Len Brown <len.brown@intel.com> > AuthorDate: Fri Apr 5 00:07:45 2019 -0500 > Commit: Len Brown <len.brown@intel.com> > CommitDate: Tue Jul 12 00:12:09 2005 -0400 > > author Len Brown <len.brown@intel.com> 1554440865 -0500 > committer Len Brown <len.brown@intel.com> 1121141529 -0400 > > [...] It looks like quite a random timestamp, and committer timestamp > look reasonable, relative to the other commits around it. It is quite possible that Len Brown had a similar problem to what I experienced yesterday: my clock was set one hour and 22 years into the future, but I have no idea how that happened. My only guess is a half-succeeded ntpdate call, but somehow I doubt that. Ciao, Dscho ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Invalid dates in git log 2007-12-12 14:59 ` Johannes Schindelin @ 2007-12-12 18:57 ` Junio C Hamano 0 siblings, 0 replies; 7+ messages in thread From: Junio C Hamano @ 2007-12-12 18:57 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Jeff King, Eirik Bjørsnøs, git Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > On Wed, 12 Dec 2007, Junio C Hamano wrote: > >> Author: Len Brown <len.brown@intel.com> >> AuthorDate: Fri Apr 5 00:07:45 2019 -0500 >> Commit: Len Brown <len.brown@intel.com> >> CommitDate: Tue Jul 12 00:12:09 2005 -0400 >> >> author Len Brown <len.brown@intel.com> 1554440865 -0500 >> committer Len Brown <len.brown@intel.com> 1121141529 -0400 >> >> [...] It looks like quite a random timestamp, and committer timestamp >> look reasonable, relative to the other commits around it. > > It is quite possible that Len Brown had a similar problem to what I > experienced yesterday: my clock was set one hour and 22 years into the > future, but I have no idea how that happened. My only guess is a > half-succeeded ntpdate call, but somehow I doubt that. But how would you explain the more reasonable committer date? I am guessing that this particular commit was rebased (using rebase, rebase -i, stgit, guilt or something else), and whatever tool that was used had some thinko that broke the author timestamp (and zone). Nah, exonerate guilt and rebase -i from the list. The commit is from July 2005 which means there wasn't much usable tool for rebasing in the core distribution. Interactive rebase did not exist back then, and rebase was done with "git-commit-script -m", which took an existing commit and used its metainformation when creating a commit. This was almost totally different codepath from what we have now. Not even format-patch nor applymbox existed. StGIT 0.4 (initial) was Jul 10, 2005, so it is _possible_ (I do not know about plausibility) that it had an early bug that caused this, but if we really want to figure it out we need to ask Len what was used, and I suspect the most likely answer is "are you crazy enough to expect me to remember?". I am personally more interested in the other one, which was much more recent incident, though. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Invalid dates in git log 2007-12-12 9:23 ` Jeff King 2007-12-12 9:35 ` Junio C Hamano @ 2007-12-12 14:19 ` Eirik Bjørsnøs 2007-12-12 15:51 ` Andreas Ericsson 1 sibling, 1 reply; 7+ messages in thread From: Eirik Bjørsnøs @ 2007-12-12 14:19 UTC (permalink / raw) To: Jeff King; +Cc: git > Your best guess is probably the committer information. Try this: Thanks Jeff, Junio, I'll just use the committer date instead. Being a Git newbie (only started looking at it yesterday) I'm not sure my understanding of "author" and "committer" and how they releate to dates is correct: * author: Original source of the change. This person may typically have sent a committer an email with a patch. It's the commiter's responsibility to supply this information. * author date: The commiter is free to specify a date for the contribution. * committer: First committer to actually add this change to a repository * committer date: Date of the actual commit, added by the git client during the commit. Typically the system clock at the time of the commit. * A transfer of a commit across repositories (pull, push) will not change the author, commit or date information If I got some of this wrong, I'd be happy if someone would correct me. Thanks, Eirik. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Invalid dates in git log 2007-12-12 14:19 ` Eirik Bjørsnøs @ 2007-12-12 15:51 ` Andreas Ericsson 0 siblings, 0 replies; 7+ messages in thread From: Andreas Ericsson @ 2007-12-12 15:51 UTC (permalink / raw) To: Eirik Bjørsnøs; +Cc: Jeff King, git Eirik Bjørsnøs wrote: >> Your best guess is probably the committer information. Try this: > > Thanks Jeff, Junio, > > I'll just use the committer date instead. > > Being a Git newbie (only started looking at it yesterday) I'm not sure > my understanding of "author" and "committer" and how they releate to > dates is correct: > They're often the same. They will end up being different if * you cherry-pick a commit made by someone else. ("someone else" is author, you are the committer) * you rebase a series of commit containing changes from others ("others" are the authors, you are the committer) * you apply a patch using "git am" from someone ("someone" is the author, you are the committer) * you "git commit --amend" a commit from someone else ("someone else" is author, you are the committer) There are probably other cases, but those were the ones I could think of right now. In short, whenever a commit is modified in some way, it gets a new committer. It might help if you think of author as "contributor" and "committer" as "integrator", where various integrators merge between each other. A merge obviously doesn't fiddle with commits, so once a commit has entered an integrators repository, both author and committer stays intact (that's not strictly true, but for the sake of this argument, which concerns the linux kernel, it will suffice and be mostly correct insofar as I understand the kernel workflow). > * author: Original source of the change. This person may typically > have sent a committer an email with a patch. It's the commiter's > responsibility to supply this information. No, it's the author's responsibility to supply this information. Author is hardly ever changed. > * author date: The commiter is free to specify a date for the contribution. > No, the author does that too :) > * committer: First committer to actually add this change to a repository No, committer is the person who added the commit to the repository by some other means than merging from another repository. > * committer date: Date of the actual commit, added by the git client > during the commit. Typically the system clock at the time of the > commit. > Sort of, yes, although commits can be created by other means than just running "git commit". The operations listed in bullets at the top of this mail all create new commits, in the sense that they can't have the same SHA1 as their original ones. Hence, committer and commitdate must be updated. > * A transfer of a commit across repositories (pull, push) will not > change the author, commit or date information > True. Since neither ancestry nor content is allowed to change, the commit will be exactly the same in the new repository as it was in the old one. > If I got some of this wrong, I'd be happy if someone would correct me. > I think I just did. Perhaps I missed something, but I'm sure someone will correct me if that's the case. -- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-12-12 18:58 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-12-12 9:11 Invalid dates in git log Eirik Bjørsnøs 2007-12-12 9:23 ` Jeff King 2007-12-12 9:35 ` Junio C Hamano 2007-12-12 14:59 ` Johannes Schindelin 2007-12-12 18:57 ` Junio C Hamano 2007-12-12 14:19 ` Eirik Bjørsnøs 2007-12-12 15:51 ` Andreas Ericsson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).