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

Re: [RFC PATCH v2] Add 'human' date format

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 24, 2018, 21:49 UTC
Message-ID
<xmqqtvoowbgi.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<alpine.LFD.2.21.999.1807071502260.18818@i7.lan>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 7 quoted lines
> From: Linus Torvalds <torvalds@linux-foundation.org>
>
> This adds --date=human, which skips the timezone if it matches the
> current time-zone, and doesn't print the whole date if that matches (ie
> skip printing year for dates that are "this year", but also skip the
> whole date itself if it's in the last few days and we can just say what
> weekday it was).
The behavior of the code does not quite match my intuition, though.
    $ date ;# to show that I am in -0700 zone
    Tue Jul 24 14:42:09 PDT 2018
    $ git show -s pk/rebase-in-c | head -n 3
    commit d18b5221ba98fe8254c3f9922ba31b21d7c954af
    Author: Pratik Karki <predatoramigo@gmail.com>
    Date:   Sun Jul 8 23:46:04 2018 +0545
    $ git show --date=human -s pk/rebase-in-c | head -n 3
    commit d18b5221ba98fe8254c3f9922ba31b21d7c954af
    Author: Pratik Karki <predatoramigo@gmail.com>
    Date:   Sun Jul 8 23:46

It is sensible to omit the seconds; I do not really care about that level of precision for an event that happened two weeks ago in a different continent.

But lack of TZ does not give me enough hint about which content it happened. The fact that this was done late at night on weekend is indeed interesting, and I may not care what time it locally was for me, so perhaps this is an intended behaviour.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 12 of 14 in “Add 'human' date format”
  1. Add 'human' date formatLinus Torvalds, Jul 7, 2018
  2. Linus TorvaldsJul 7, 2018
  3. Linus TorvaldsJul 7, 2018
  4. Add 'human' date formatLinus Torvalds, Jul 7, 2018
  5. Andrei RybakJul 11, 2018
  6. Andrei RybakJul 11, 2018
  7. Junio C HamanoJul 11, 2018
  8. Linus TorvaldsJul 11, 2018
  9. Linus TorvaldsJul 11, 2018
  10. Ævar Arnfjörð BjarmasonJul 11, 2018
  11. Linus TorvaldsJul 11, 2018
  12. Junio C HamanoJul 24, 2018
  13. Linus TorvaldsJul 24, 2018
  14. Stephen P. SmithNov 27, 2018

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.