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

Re: RFC: dynamic "auto" date formats

From
Jeff King <peff@peff.net>
Date
May 27, 2016, 04:00 UTC
Message-ID
<20160527040031.GB24972@sigill.intra.peff.net>
In-Reply-To
<CA+55aFzWEf2sN647v0mfiPOFE=KindQpweoHwdPmDshUb0YVsA@mail.gmail.com>
On Thu, May 26, 2016 at 08:36:57PM -0700, Linus Torvalds wrote:
Show 11 quoted lines
> Note that this doesn't add any gitconfig setting to do this, which
> would be part of the whole point if this is actually sensible. But I'm
> not entirely convinced it's worth it in the first place, thus this
> email to see how people react ("That's just stupid" vs "yeah, I didn't
> even know I wanted it, but now I need it").
> 
> And no, I'm not at all sure that the 24-hour cut-off is the right
> thing, but it didn't seem completely crazy either. I tend to like the
> relative date format when it is "19 minutes ago" vs "2 hours ago", at
> some point it's long enough ago that it's more useful to know "Tuesday
> at 3pm" than about how long ago it was.

Seems like a reasonable idea, though I doubt I'd use it myself. In addition to possibly making the cutoff-time configurable, I'd expect people would want the fallback format to be configurable, too.

I wonder if something like:
  --date=relative:24h:iso

would make sense as "relative up to 24 hours, then iso". You could even chain them, so your:

Show 5 quoted lines
> (And yes, it would be even better to have the "short term relative
> date" turn into a "medium-term 'day of the week at time x'" and then
> turn into "full date" when it's more than a week ago, but this patch
> only has the two modes of "short term" and "long term" and nothing in
> between).
could be something like:
  --date=relative:24h:short:1w:normal

(where "short" actually kind of sucks; we'd introduce a new format for your "Tuesday at 10pm" output).

I admit it's a bit baroque to look at, though.
-Peff
Previous: Linus TorvaldsNext: Junio C Hamano
Message 2 of 4 in “RFC: dynamic "auto" date formats”
  1. Linus TorvaldsMay 27, 2016
  2. Jeff KingMay 27, 2016
  3. Junio C HamanoMay 27, 2016
  4. Junio C HamanoMay 27, 2016

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.