git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] approxidate: allow ISO-like dates far in the future

From
Jeff King <peff@peff.net>
Date
Nov 13, 2014, 21:36 UTC
Message-ID
<20141113213647.GB7563@peff.net>
In-Reply-To
<xmqqr3x6ztyl.fsf@gitster.dls.corp.google.com>
On Thu, Nov 13, 2014 at 01:11:46PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> >  		if (c != '.' &&
> > -		    is_date(num3, num, num2, refuse_future, now, tm))
> > +		    is_date(num3, num, num2, refuse_future, now, tm, 0))
> >  			break;
> 
> Doesn't the new argument '0', which is "allow-future", look somewhat
> strange when we are already passing refuse_future?

To be honest, I had trouble figuring out what the name "refuse_future" really meant. We do skip the future check, but it also means that is_date will munge the "struct tm" directly, even if we do not find a valid date. That worried me a bit.

But yeah, in theory, the callers I wanted to tweak can just pass in a NULL refuse_future.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 7 of 11 in “Bug: git log showing nothing when using --since and --until flags with specific dates”
  1. Colin SmithNov 13, 2014
  2. Jeff KingNov 13, 2014
  3. 0/2 approxidate and future ISO-like timesJeff King, Nov 13, 2014
  4. 1/2 pass TIME_DATE_NOW to approxidate future-checkJeff King, Nov 13, 2014
  5. 2/2 approxidate: allow ISO-like dates far in the futureJeff King, Nov 13, 2014
  6. Junio C HamanoNov 13, 2014
  7. Jeff KingNov 13, 2014
  8. Jeff KingNov 13, 2014
  9. Junio C HamanoNov 13, 2014
  10. Jeff KingNov 14, 2014
  11. Junio C HamanoNov 14, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.