Re: [PATCH] Round-down years in "years+months" relative date view
From: Alex Riesen <hidden>
Date: 2016-06-15 22:47:19
On Fri, Aug 28, 2009 at 08:05, Jeff King[off-list ref] wrote:
On Thu, Aug 27, 2009 at 04:39:38PM -0700, David Reiss wrote:quoted
Previously, a commit from 1 year and 7 months ago would display as "2 years, 7 months ago".Wow, embarrassing. Acked-by: Jeff King <redacted>quoted
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?!!