From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [EGIT PATCH] Committer, author and tagger time should not be parsed as 32 bit signed int
Date: Thu, 18 Dec 2008 01:09:51 +0100 [thread overview]
Message-ID: <200812180109.51987.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <20081217224844.GK32487@spearce.org>
onsdag 17 december 2008 23:48:44 skrev Shawn O. Pearce:
> Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > If not dates past 2038 will be parsed the wrong way when
> > parsed into a RevCommit or RevTag object.
>
> Uhm, sure.
>
> But there's also the commitTime field in RevCommit, its used to
> sort commits during walking. In 2038 that will also overflow.
Ok, but that's not used for display purposes, which what I saw. How
huge is the cost of a long here. Most processor handle longs
well today, though many megs of them will hurt the cache.
> Also, if you search the code for '2038' you'll find a remark
> about the year 2038 in DirCacheEntry.smudgeRacilyClean. Last
> I looked at the git sources I think this field in the index is
> treated as a signed time_t so we can't set the high bits and
> extend it out another 60+ years.
That is another time stamp. It is a file time stamp, which we
never store in the Git object database. The index can be revised over time since
it is purely local structure. If it weren't for the need to operate
with C Git in the same repo we could have used a different format,
and nobody would notice. (The first jgit versions used a different
index structure).
time_t is signed, but it is also 64 bit on 64-bit linux so it doesn't overflow in 2038.
$ cev 'printf("sizeof time =%d\n",sizeof(time_t));'
sizeof time =8
> I'd rather just tag the fields with "2038" so we can search for
> them in the future. Like say this:
There should be a comment on the commitTime field too if we choose
that option.
-- robin
prev parent reply other threads:[~2008-12-18 0:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-17 0:07 [EGIT PATCH 0/2] *** SUBJECT HERE *** Robin Rosenberg
2008-12-17 0:07 ` [EGIT PATCH 1/2] Revert "Fix commit id in egit test T0001_ConnectProviderOperationTest" Robin Rosenberg
2008-12-17 0:07 ` [EGIT PATCH 2/2] Fixed an old failed EGit unit test Robin Rosenberg
2008-12-17 16:09 ` [EGIT PATCH 1/2] Revert "Fix commit id in egit test T0001_ConnectProviderOperationTest" Shawn O. Pearce
2008-12-17 22:28 ` Robin Rosenberg
2008-12-17 22:32 ` Shawn O. Pearce
2008-12-17 22:32 ` [EGIT PATCH] Committer, author and tagger time should not be parsed as 32 bit signed int Robin Rosenberg
2008-12-17 22:48 ` Shawn O. Pearce
2008-12-18 0:09 ` Robin Rosenberg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200812180109.51987.robin.rosenberg.lists@dewire.com \
--to=robin.rosenberg.lists@dewire.com \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).