[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jgit-dev] RevSort#COMMIT_TIME_DESC confusion
|
The timezones are specified here (+0100, +0300). You should be able to apply the offsets to calculate the UTC; the numbers you cited are local times. There's almost 2h difference between these two commits.
Alex
Sent from my (old) iPhone
On 12 Aug 2011, at 13:04, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
>> Could it be a cross-timezone issue, if local time is used instead of UTC?
>
> Looks like you are right, though I don't understand the reasons of this
> effect. These are the offending commits (taken from the IDEA community
> repository):
>
> commit d4f3d4c655295e2b1cf1d90374f8b8e18fdc3dac
> tree 02d25f4ce8b2b45ef5e8af6fadbd1d328cb16f22
> parent 676abb30545bf63409ab061b2fdcd021736896be
> author Sergey Evdokimov <sergey.evdokimov@xxxxxxxxxxxxx> 1300978514 +0300
> committer Sergey Evdokimov <sergey.evdokimov@xxxxxxxxxxxxx> 1301056269 +0300
>
> Add method 'toString()' to IntArrayList.
>
> commit 676abb30545bf63409ab061b2fdcd021736896be
> tree d93631c534c20a088cb2e4fb5a5c6c2dfea108ac
> parent bea282d766d21e636752d0f50d603f23e4f868f3
> author peter <peter@xxxxxxxxxxxxx> 1301056144 +0100
> committer peter <peter@xxxxxxxxxxxxx> 1301056346 +0100
>
> once the first calculation is finished, don't move the lookup
>
> 1301056269 is slightly before 1301056346, whereas order according to
> local time would be correct. So does RevSort#COMMIT_TIME_DESC assert
> correct order on local time?
>
> What I'm looking for is a quick and reliable check whether a certain
> TARGET commit is reachable from another SRC commit. Currently I'm doing
> a RevWalk with RevSort#COMMIT_TIME_DESC starting at SRC and stopping
> once I either encounter TARGET or another commit X with commit-time(X) <
> commit-time(TARGET). Now, according to upper example, that doesn't work
> correctly. If it's about timezones, I could run until commit-time(X) <
> commit-time(TARGET - 24 hours). However, I'm wondering if order of
> commit-times are reliable at all? Can they arbitrarily jump back and
> force or are there some restrictions on the order of timestamps in Git
> repositories?
>
> --
> Best regards,
> Marc Strapetz
> =============
> syntevo GmbH
> http://www.syntevo.com
> http://blog.syntevo.com
>
>
>
> On 12.08.2011 12:20, Alex Blewitt wrote:
>> Could it be a cross-timezone issue, if local time is used instead of UTC?
>>
>> Sent from my (old) iPhone
>>
>> On 12 Aug 2011, at 09:55, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
>>
>>> I was relying on RevSort#COMMIT_TIME_DESC to report RevCommits always in
>>> descending order, however this is not the case for certain repositories,
>>> i.e. the commit time of a parent may be more recent than the entry's
>>> commit time itself (does anyone know why that can happen?). IMHO this
>>> behavior should be documented in the javadocs.
>>>
>>> --
>>> Best regards,
>>> Marc Strapetz
>>> =============
>>> syntevo GmbH
>>> http://www.syntevo.com
>>> http://blog.syntevo.com
>>> _______________________________________________
>>> jgit-dev mailing list
>>> jgit-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/jgit-dev
>>
>>