Re: [PATCH] Round-down years in "years+months" relative date view
- From
Jeff King <peff@peff.net>
- Date
- Aug 28, 2009, 15:02 UTC
- Message-ID
- <20090828150212.GA6013@coredump.intra.peff.net>
- In-Reply-To
- <81b0412b0908280058i364bfb83nb04354d982abc053@mail.gmail.com>
On Fri, Aug 28, 2009 at 09:58:27AM +0200, Alex Riesen wrote:
Show 11 quoted lines
> > I couldn't find any tests related to relative date processing, so it > > would be really nice to have some. But I'm not sure of the best way to > > do it without dealing with race conditions. Annoyingly, show_date calls > > gettimeofday at a pretty low level, so there isn't a way of > > instrumenting it short of LD_PRELOAD trickery (which is probably not > > very portable). > > Maybe better prepare the _test_ so that it uses current time and time > arithmetics then put yet another cludge in operational code? Especially > when we already have a greate number of GIT_ environment variables, > documented nowhere, with effects not immediately obvious:
But that's the point: you can't do that without a race condition. Your test gets a sense of the current time, then runs git, which checks the current time again. How many seconds elapsed between the two checks?
I guess it is good enough for testing large time spans, but I was hoping for a comprehensive time test.
-Peff