Thread (25 messages) flat view 25 messages, 5 authors, 2016-06-15

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 20:42, Alex Riesen[off-list ref] wrote:
On Fri, Aug 28, 2009 at 20:39, Jeff King[off-list ref] wrote:
quoted
On Fri, Aug 28, 2009 at 08:27:06PM +0200, Alex Riesen wrote:
quoted
quoted
Thanks, that is a much better solution. And I don't know offhand of any
portability problems in overriding the library at link time.
Hm, how about supplying show_date and approxidate with current time?
Like this:

/* exported */
const char *show_date_rel(unsigned long time, int tz, struct timeval *now)
{
... the DATE_RELATIVE path of show_date
}

const char *show_date(unsigned long time, int tz, enum date_mode mode)
{
  struct timeval now;
  if (mode == DATE_RELATIVE) {
    gettimeofday(&now, NULL);
    return show_date_rel(time, tz, &now);
  }
  ... other paths of old show_date
}

Still affects the performance, but much less, and no side effects.
And you can test show_date_rel path in test-date.c
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help