From: Alex Riesen Date: Fri, 28 Aug 2009 07:58:27 GMT Subject: Re: [PATCH] Round-down years in "years+months" relative date view Message-ID: <81b0412b0908280058i364bfb83nb04354d982abc053@mail.gmail.com> In-Reply-To: <20090828060538.GA22416@coredump.intra.peff.net> On Fri, Aug 28, 2009 at 08:05, Jeff King wrote: > On Thu, Aug 27, 2009 at 04:39:38PM -0700, David Reiss wrote: > >> Previously, a commit from 1 year and 7 months ago would display as >> "2 years, 7 months ago". > > Wow, embarrassing. > > Acked-by: Jeff King > >> Here's my test script.  Let me know if you'd rather have it as part >> of the test suite. > > 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: $ git grep -n '"GIT_'| perl -ne '/"(GIT_\w+)/ && print "$1\n"' | sort |uniq | wc -l 49 $ git grep -n '"GIT_'|grep ^Documentation $ GIT_FLUSH? GIT_SEND_EMAIL_NOTTY?! GIT_CHERRY_PICK_HELP?!!