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

Re: [BUG REPORT] --date argument doesn't validate dates

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Apr 22, 2020, 21:26 UTC
Message-ID
<20200422212633.GI6465@camp.crustytoothpaste.net>
In-Reply-To
<d633919a-99a4-0b90-f355-66a17000f83f@rawbw.com>
On 2020-04-22 at 20:40:48, Yuri wrote:
> For example, the following command accepts an invalid month "Dx" and an
> invalid year "20221" and sets the month to "Apr" and the year to "2020".

The --date argument accepts a wide variety of formats, including some formally specified ones, as well generalized handling through the "approxidate" approach. So it's designed to operate on formats that are not well understood and do the best it can with them. This also allows it do things like ignore the irrelevant word "ago" in "5 days ago" and still do the right thing.

If you want to be sure that your date is uniformly understood, then the best approach is to either use the Git internal format or RFC 3339 (which is a profile of ISO 8601).

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Yuri
Message 2 of 2 in “[BUG REPORT] --date argument doesn't validate dates”
  1. YuriApr 22, 2020
  2. brian m. carlsonApr 22, 2020

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.