From: "René Scharfe" <l.s.r@web.de>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Jeff King" <peff@peff.net>
Cc: Ulrich Mueller <ulm@gentoo.org>,
Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] strbuf: let strbuf_addftime handle %z and %Z itself
Date: Tue, 13 Jun 2017 00:31:44 +0200 [thread overview]
Message-ID: <c7532160-53eb-a0c5-94e6-483aadf0cfc5@web.de> (raw)
In-Reply-To: <CACBZZX5OQc45fUyDVayE89rkT=+8m5S4efSXCAbCy7Upme5zLA@mail.gmail.com>
Am 12.06.2017 um 21:02 schrieb Ævar Arnfjörð Bjarmason:
> I only ever use the time offset info to quickly make a mental note of
> "oh +0200, this guy's in Europe", or "oh -0400 America East". Having
> any info at all for %Z would allow me to easily replace that already
> buggy mapping that exists in my head right now with something that's
> at least a bit more accurate, e.g. I remember that +0900 is Japan, but
> I can't now offhand recall what timezones India is at.
>
> Now, obviously we can't know whether to translate e.g. -0400 to New
> York or Santiago, but for the purposes of human readable output I
> thought it would be more useful to guess than show nothing at all. So
> for that purpose the most useful output of %Z *for me* would be just
> showing a string with the 3 most notable cities/areas, weighted for
> showing locations on different continents, e.g.:
>
> +0000 = Iceland, West Africa, Ittoqqortoormiit
> +0100 = London, Lisbon, Kinshasa
> ...
> +0900 = Tokyo, Seul, Manokwari
> ....
> -0900 = San Francisco, Vancouver, Tijuana
> ....
> -0600 = Denver, Managua, Calgary
>
> Then I could run:
>
> git log --date=format-local:"%Y[...](%Z)"
>
> And get output like:
>
> commit 826c06412e (HEAD -> master, origin/master, origin/HEAD)
> Author: Junio C Hamano <gitster@pobox.com>
> Date: Fri Jun 2 15:07:36 2017 +0900 (San Francisco, Vancouver,
> Tijuana etc.)
>
> Fifth batch for 2.14
> [...]
> commit 30d005c020
> Author: Jeff King <peff@peff.net>
> Date: Fri May 19 08:59:34 2017 -0400 (New York, Havana, Santiago etc.)
>
> diff: use blob path for blob/file diffs
>
> Which gives me a pretty good idea of where the people who are making
> my colleges / collaborators who are making commits all over the world
> are located, for the purposes of reinforcing the abstract numeric
> mapping with a best-guess at what the location might be, or at least
> something that's close to the actual location.
Half the time this would be off by a zone in areas that use daylight
saving time, or you'd need to determine when DST starts and ends, but
since that depends on the exact time zone it will be tricky.
You could use military time zones, which are nice and easy to convert:
Alpha (UTC+1) to Mike (UTC+12) (Juliet is skipped), November (UTC-1) to
Yankee (UTC-12), and Zulu time zone (UTC+0). Downside: Most civilians
don't use them. :) Also there are no names for zones that have an
offset of a fraction of an hour.
> I'd definitely use a feature like that, and could hack it up on top of
> the current patches if there wasn't vehement opposition to it. Maybe
> the above examples change someone's mind, I can't think of a case
> where someone's relying on %Z now for date-local, or at least cases
> where something like the above wouldn't be more useful in practice
> than just an empty string, but if nobody agrees so be it :)
Personally I don't have a use for time information; dates alone would
suffice for me -- so I certainly won't hold you back. But I don't see
how it could be done.
René
next prev parent reply other threads:[~2017-06-12 22:32 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 18:33 git-2.13.0: log --date=format:%z not working Ulrich Mueller
2017-05-27 16:57 ` Ævar Arnfjörð Bjarmason
2017-05-27 21:46 ` Jeff King
2017-05-28 10:29 ` Ævar Arnfjörð Bjarmason
2017-05-29 0:53 ` Junio C Hamano
2017-05-28 11:43 ` René Scharfe
2017-06-02 2:23 ` Junio C Hamano
2017-06-02 3:08 ` Jeff King
2017-06-02 17:25 ` René Scharfe
2017-06-02 18:35 ` Jeff King
2017-06-02 22:04 ` Ulrich Mueller
2017-06-02 22:30 ` Jeff King
2017-06-02 22:47 ` Ulrich Mueller
2017-06-02 22:51 ` Jeff King
2017-06-03 10:40 ` [PATCH] strbuf: let strbuf_addftime handle %z and %Z itself René Scharfe
2017-06-03 13:13 ` Ulrich Mueller
2017-06-03 16:20 ` René Scharfe
2017-06-07 8:17 ` Jeff King
2017-06-07 9:13 ` [PATCH] date: use localtime() for "-local" time formats Jeff King
2017-06-11 17:36 ` [PATCH] strbuf: let strbuf_addftime handle %z and %Z itself René Scharfe
2017-06-12 15:12 ` Junio C Hamano
2017-06-12 16:16 ` Ævar Arnfjörð Bjarmason
2017-06-12 16:56 ` Ulrich Mueller
2017-06-12 17:53 ` Ævar Arnfjörð Bjarmason
2017-06-12 18:15 ` Junio C Hamano
2017-06-12 18:20 ` Jeff King
2017-06-12 19:02 ` Ævar Arnfjörð Bjarmason
2017-06-12 21:10 ` Jeff King
2017-06-13 6:23 ` Linus Torvalds
2017-06-12 22:31 ` René Scharfe [this message]
2017-06-13 10:16 ` Ævar Arnfjörð Bjarmason
2017-06-13 10:31 ` Ulrich Mueller
2017-06-12 16:58 ` René Scharfe
2017-06-12 17:36 ` Jeff King
2017-06-15 8:46 ` [PATCH v2] " René Scharfe
2017-06-15 11:27 ` Ulrich Mueller
2017-06-15 12:28 ` René Scharfe
2017-06-15 12:29 ` [PATCH v3] " René Scharfe
2017-06-15 13:49 ` Jeff King
2017-06-15 13:51 ` [PATCH 1/2] t0006: check --date=format zone offsets Jeff King
2017-06-15 13:52 ` [PATCH 2/2] date: use localtime() for "-local" time formats Jeff King
2017-06-15 16:12 ` René Scharfe
2017-06-15 21:40 ` Junio C Hamano
2017-06-16 12:18 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c7532160-53eb-a0c5-94e6-483aadf0cfc5@web.de \
--to=l.s.r@web.de \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=torvalds@linux-foundation.org \
--cc=ulm@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).