Re: git and time
- From
Tom Prince <tom.prince@ualberta.net>
- Date
- Sep 28, 2006, 03:26 UTC
- Message-ID
- <20060928032655.GB3650@socrates.priv>
- In-Reply-To
- <20060928024938.46785.qmail@web51009.mail.yahoo.com>
On Wed, Sep 27, 2006 at 07:49:37PM -0700, Matthew L Foster wrote:
> How does git ensure that the timestamp in a commit records when it was > actually created?
Git doesn't try. Git would be perfectly happy if time(2) returned a random value each time. No part of git uses the time in any meaningful way, it just keeps a record of it to display.
> I am not saying throw away creation time, just that local time is more > preferable and relevant and git/gitweb.cgi should not in any way > depend on time being configured correctly on each and every git > server.
git and gitweb.cgi DO NOT in any way depend on time being configured correctly. If some machine has incorrectly configured time, then they will *correctly* display the strange time.
> I think users of kernel.org's repo (or web interface) care > more about when change X was commited to it than when an author > created/emailed change X, but perhaps I am wrong or don't understand > git or both.
Based on comments on this list, it appears that most people don't aren't interested in when exactly a given change hits kernel.org. Several people have pointed out ways to get at the information you want, but none of have seen a need for the information, and so haven't the motivation to implement.
It might help if you gave a use case for the information you want. If you give us a problem that you think the information will solve, the list will probably be able to you how to get at the information you want.
I think you have some misconception of how git works. Git is designed to not lose information. Once a commit is created it is immutable, regardless of whether the time is wrong, or the author, or the commit message, or any bugs in the commit. This is a *feature*. It means you need to go out of your way to destroy history.
> -Matt
Tom