git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Ambiguous date handling
Date: Wed, 12 Sep 2012 22:09:37 +1200	[thread overview]
Message-ID: <50505F61.8040100@gmail.com> (raw)
In-Reply-To: <7v4nn3fu6s.fsf@alter.siamese.dyndns.org>

On 09/12/2012 09:48 PM, Junio C Hamano wrote:
> Chris Packham <judge.packham@gmail.com> writes:
> 
>> Our default MUA has an annoying habit of using a non RFC822 date format when
>> saving an email as plaintext. This means the first 12 days of every month we
>> run into the ambiguous date problem (our date convention is dd/mm/yy).
>>
>> I see code in date.c for refusing a date in the future which would have caught
>> this...
> 
> The most sane thing to do when you know that your MUA *consistently*
> does dd/mm/yy (even though it may annoy you) is to massage its
> output before feeding it to Git.  And it should be a very simple
> matter of a one-liner filter, no?

Consistent as long as you save as the default .txt. Some people have
trained themselves to use the save as .eml option which uses RFC822
style output. sed 's|Date: (\d+)/(\d+)/(\d+)|\1.\2.\3|' should correct
the former and ignore the latter. Could this be done in a applypatch-msg
hook?

> 
> Regardless of the correctness of that "we reject timestamps way into
> the future" logic, it should be taken as the last resort.  If you
> are on September 1st, both 9/12 and 12/9 will look like into the
> future for more than ten days (which is the cut-off, I think).  If
> you are on December 28th, both look like sufficiently in the past.
> 

Duly noted. And I'm implying that the reject timestamps in future isn't
actually working. I've just started looking at t0006-date.sh so see if I
can prove it.

  reply	other threads:[~2012-09-12 10:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  9:35 Ambiguous date handling Chris Packham
2012-09-12  9:35 ` [PATCH] Add test for ambiguous patch dates Chris Packham
2012-09-12  9:48 ` Ambiguous date handling Junio C Hamano
2012-09-12 10:09   ` Chris Packham [this message]
2012-09-12 16:58     ` 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=50505F61.8040100@gmail.com \
    --to=judge.packham@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).