Re: [PATCH] strbuf: let strbuf_addftime handle %z and %Z itself

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 12, 2017 at 07:53:21PM +0200, Ævar Arnfjörð Bjarmason wrote:

> >> Of course we can never know if you were in Tokyo or Seul from the info
> >> in the commit object, but we don't need to, it's enough that we just
> >> emit JST for +0900 and anyone reading the output has at least some
> >> idea what +0900 maps to.
> >
> > Please don't. Outputting invented information for something that
> > really isn't in the data is worse than outputting no information at
> > all.
> 
> It's not invented information. %z being +0900 is the same thing as %Z
> being JST since +0900 == JST, just because some other things are also
> == +0900 that doesn't mean that JST is invalid or less useful than
> +0900 or "" for the purposes of human-readable output.

I think the main problem is that the mapping isn't just "JST->+0900".
It's a set of rules that depend on the specific time being converted. So
it's true that at some time t, +0900 may mean JST or KST or whatever.
But at a different time, those time zones will map to a different
offset.

So I think at best this is semantically confusing (the author was not in
JST, but just happened to be in a time zone that maps to the same thing
at that moment, and any attempt to extrapolate their zone at another
time is going to be wrong). And at worst the output of "git log" is
going to show the same user flip-flopping between zones as their commits
move around with respect to the (politically determined) zone changes.
For instance in my time zone I'd shift between EST and CST twice per
year due to DST. My real time zone is EST5EDT, or better still,
America/New_York (I don't live there, but the Olson database carves up
regions based on the most populous city in the zone).

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]