Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 May 2019 22:18:16 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Grzegorz Junka <list1@gjunka.com>, freebsd-git@freebsd.org
Subject:   Re: Git handling of commit times
Message-ID:  <CAPyFy2AA=GzuRhG5z1Y2gWFJUsw94zOSk6c4j=wXi%2B9URwR7eQ@mail.gmail.com>
In-Reply-To: <CANCZdfpoaqpNpKZrPmkdvZxMty4ZA2xj51Zu_brJrAdydDAakg@mail.gmail.com>
References:  <8697933A-B813-4088-90B7-A84589C3CD33@freebsd.org> <CAPyFy2Bqg6m8D6rO%2Bg87Wk74iBYOGfq%2B=t6B_VhUM26mUZXO%2BQ@mail.gmail.com> <6fb4c8cb-7f59-872e-4de6-a8a02e7c4e29@gjunka.com> <CAPyFy2CkyET7v6hTfhv8ZQ=%2BSYM_yyhtBwzM3GfS3funaDBZHQ@mail.gmail.com> <82938a26-892e-0459-aa23-bdcd9e318b6c@gjunka.com> <CAPyFy2Dm9yWepO6P8jyF%2BNZDA=ZUpg0tYUQ8zRTAKkVWp6cHhw@mail.gmail.com> <CANCZdfpoaqpNpKZrPmkdvZxMty4ZA2xj51Zu_brJrAdydDAakg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 29 May 2019 at 17:26, Warner Losh <imp@bsdimp.com> wrote:
>
> The very simple work flow of
>
> git branch -b foo
> hack
> git commit
> <time passes>
> git checkout master
> git pull
> git rebase -i master foo
> <repeat sequence>
>
> would setup a situation where commits are in the past. By default, rebase=
 commits don't have their timestamps reset.

Rebasing does reset the commit timestamp (and not the author
timestamp). I don't think we should impose any constraints on author
timestamps in a Git workflow. But these two things should be
invariants: the commit timestamp of a change is not earlier than any
of its parents, and the commit timestamp is not later than now.

> Also, resetting the time changes the hash of the commit, iirc.

Yes, changing anything in the state of the tree or the commit's
metadata will change the hash. (Notes are not included in this.)

> Depends on how far in the future. Time is an illusion. git commit time do=
ubly so :) But this assumes that all the world's clocks are in sync, and th=
ey are not. minutes of difference often exist. it's a royal pita to be on t=
he wrong side of the sync when pushing commits upstream to a server you hav=
e no control over the time of.

I'd hope we can be reasonably sure about the time on (say)
git.freebsd.org, but point taken. Perhaps something like "not more
than 1 minute in the future, relative to the server's clock."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2AA=GzuRhG5z1Y2gWFJUsw94zOSk6c4j=wXi%2B9URwR7eQ>