git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Colin Smith <colin.webdev@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] approxidate: allow ISO-like dates far in the future
Date: Thu, 13 Nov 2014 16:36:48 -0500	[thread overview]
Message-ID: <20141113213647.GB7563@peff.net> (raw)
In-Reply-To: <xmqqr3x6ztyl.fsf@gitster.dls.corp.google.com>

On Thu, Nov 13, 2014 at 01:11:46PM -0800, Junio C Hamano wrote:

> 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

  reply	other threads:[~2014-11-13 21:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  0:27 Bug: git log showing nothing when using --since and --until flags with specific dates Colin Smith
2014-11-13  9:36 ` Jeff King
2014-11-13 11:03   ` [PATCH 0/2] approxidate and future ISO-like times Jeff King
2014-11-13 11:04     ` [PATCH 1/2] pass TIME_DATE_NOW to approxidate future-check Jeff King
2014-11-13 11:07     ` [PATCH 2/2] approxidate: allow ISO-like dates far in the future Jeff King
2014-11-13 21:11       ` Junio C Hamano
2014-11-13 21:36         ` Jeff King [this message]
2014-11-13 21:43           ` Jeff King
2014-11-13 22:36           ` Junio C Hamano
     [not found]       ` <CA+EOSBn0-ZFOPaeU92a0YWPW_S9kenoRUjJMp-Nhm-azftrEfA@mail.gmail.com>
2014-11-14  8:47         ` Jeff King
2014-11-14 22:15           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141113213647.GB7563@peff.net \
    --to=peff@peff.net \
    --cc=colin.webdev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).