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

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

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 24, 2018, 22:58 UTC
Message-ID
<CA+55aFyXRyBvpq5Yvjg8=m6fdMRO4fdpDjW=bD4Kryo-goSDJA@mail.gmail.com>
In-Reply-To
<xmqqtvoowbgi.fsf@gitster-ct.c.googlers.com>
On Tue, Jul 24, 2018 at 2:49 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 5 quoted lines
>
> 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.

I'm not sure you could call it "intended". The TZ hiding did change as I was playing with this.

The first version of the patch only hid the timezone if it matched the current one.

Because, as you say, the time zone can be interesting not so much because you care about *when* the commit happened, but you care about *where* the commit happened. And that can be true even if the commit is very old.

So the timezone data in some sense isn't necessarily about the date at all.

When I used it a bit more (I still have the "--date=auto" as my default for the kernel), I decided I really don't much care about the timezone. In any _individual_ case, the timezone looks fine, but when you look at many different dates, it looks really odd how it sometimes shows, and sometimes does not, particularly for old dates when it really doesn't matter for the *time* reason.

So I decided that it's better to not show the timezone at all when you show a real date.

But honestly, I don't claim to have a really strong argument. It's just a choice. Nothing says it's the absolute right choice.

I pointed out that you can use "--date=human-local" to get an even denser representation that gives you the human date without ever having a TZ. But we don't have the reverse of "-local", which would explicitly show the timezones.

Again, I think this is really because the timezone is about something other than just the time. I think the "do we care *where* it was done or not?" question in many ways is entirely independent of the time question.

So right now the patch says
                hide.tz |= !hide.date;

which ends up being good for the "times are roughly the same size" (which I decided was a good thing - again, I don't really have a hugely strong argument for it, it was a matter of me playing with options).

But it would make equally much sense to say
                hide.tz |= hide.time;

and just say that the timezone is hidden if it matches the current one, or if the commit is just so old that we don't show the time at all.

OR you could just say "timezone is always interesting, because you want to know _where_ it was done regardless of _when_ it was done", and just not hide the timezone at all.

I think all are "technically valid" choices to make. The one I made was just a random personal preference, not necessarily the right one.

Could we extend on the "decorations" (like the "-local" thing)? Absolutely. I'm not sure it's worth doing, but it would certainly solve the "different people have different preferences" issue.

I think that *if* we want to extend on the decorations, that would probably still be a separate patch from the basic patch.

               Linus
Previous: Junio C HamanoNext: Stephen P. Smith
Message 13 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.