Subject: Re: Back-dating commits--way back--for constitution.git

From: Jakub Narebski <[email-masked]>
Date: Tue, 3 Aug 2010 15:19:09 +0200

On Tue, 3 Aug 2010, Jeff King wrote:
> On Tue, Aug 03, 2010 at 12:02:52PM +0200, Jakub Narebski wrote:
> 
> > > Hmm, sizeof(time_t) == 8 for my x86_64 Fedora, but committing ancient
> > > times fails.
> > 
> > That's because git *porcelain* either does not use time_t consistently,
> > or has some sanity checks that are good heuristic for ordinary use (like
> > e.g. commit time not too far in past where git didn't even exists),
> > or both.
> > 
> > It is not a problem on lowest level, i.e. repository format and plumbing.
> > I was able to create a commit that had author time before Unix epoch 
> > using plumbing:
> 
> I am not sure there isn't some unportability at the lowest level. We
> freely interchange between time_t and unsigned long in the low-level
> date code. It probably happens to work because casting the bits back and
> forth between signed and unsigned types generally works, as long as you
> end up with the type that you want. But it isn't necessarily portable,
> and there can be subtle bugs. See, for example, my recent 9ba0f033.

Well, at least there is not a problem at lowest of low, i.e. repository
format level, thanks to the use of textual representation for epoch.

-- 
Jakub Narebski
Poland