Re: [PATCH] Round-down years in "years+months" relative date view
From: Jeff King <hidden>
Date: 2016-06-15 22:47:19
On Fri, Aug 28, 2009 at 09:58:27AM +0200, Alex Riesen wrote:
quoted
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