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

Re: Ambiguous date handling

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 12, 2012, 09:48 UTC
Message-ID
<7v4nn3fu6s.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1347442551-7105-1-git-send-email-judge.packham@gmail.com>
Chris Packham <judge.packham@gmail.com> writes:
Show 6 quoted lines
> 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?

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.

Previous: Chris PackhamNext: Chris Packham
Message 3 of 5 in “Ambiguous date handling”
  1. Chris PackhamSep 12, 2012
  2. Add test for ambiguous patch datesChris Packham, Sep 12, 2012
  3. Junio C HamanoSep 12, 2012
  4. Chris PackhamSep 12, 2012
  5. Junio C HamanoSep 12, 2012

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.