git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Jakub Narębski" <jnareb@gmail.com>,
	git@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>
Subject: Re: [PATCH v3 5/6] date: document and test "raw-local" mode
Date: Wed, 27 Jul 2016 15:57:03 -0400	[thread overview]
Message-ID: <20160727195703.GA8141@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqq37mux3mz.fsf@gitster.mtv.corp.google.com>

On Wed, Jul 27, 2016 at 12:49:40PM -0700, Junio C Hamano wrote:

> > @@ -746,7 +746,10 @@ format, often found in email messages.
> >  +
> >  `--date=short` shows only the date, but not the time, in `YYYY-MM-DD` format.
> >  +
> > -`--date=raw` shows the date in the internal raw Git format `%s %z` format.
> > +`--date=raw` shows the date in the internal raw Git format `%s %z`
> > +format. Note that the `-local` option does not affect the
> > +seconds-since-epoch value (which is always measured in UTC), but does
> > +switch the accompanying timezone value.
> 
> Not your fault, but "internal raw Git format X format" sounds a bit
> clunky.

Yeah, I also noticed that while writing the original, but it just
crossed over my line of "if I fix everything I don't like, this series
will never get out the door". :)

> 	shows the date in `%s %z` format (seconds since 1970-01-01
> 	00:00:00 UTC, space, timezone as sign and four digits)
>         
> or something like that?  I suspect %s is not a POSIX-kosher strftime
> conversion specifier, so from that point of view, perhaps making the
> text the authoritative description and demote the format string as a
> comment to help those who know strfmt, i.e.
> 
> 	shows the date as seconds since 1970-01-01 00:00:00 UTC,
> 	space, timezone as sign and four digits (i.e. as if the
> 	timestamp were formatted with `strftime("%s %z")`).

Yeah, I think referring to "%s %z" is pretty bad, as it's meaningless to
people who don't know strftime() off the top of their head, and %s isn't
even portable.

The second option you've shown here is much better, and I think this is
worth fixing (and it should be in a new patch, and can go on top of the
others).

I'm not sure if it's worth calling out more clearly what the timezone
means, since the epoch seconds are in UTC, as you noted here. The
follow-on sentence explains what "-local" does, but not what it means in
the non-local variant.

-Peff

  reply	other threads:[~2016-07-27 19:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 19:51 [PATCH v2 0/6] reflog docs and date-formatting Jeff King
2016-07-22 19:51 ` [PATCH v2 1/6] doc/rev-list-options: clarify "commit@{Nth}" for "-g" option Jeff King
2016-07-22 19:51 ` [PATCH v2 2/6] doc/rev-list-options: explain "-g" output formats Jeff King
2016-07-22 19:51 ` [PATCH v2 3/6] doc/pretty-formats: describe index/time formats for %gd Jeff King
2016-07-22 19:51 ` [PATCH v2 4/6] doc/pretty-formats: explain shortening of %gd Jeff King
2016-07-22 19:51 ` [PATCH v2 5/6] date: document and test "raw-local" mode Jeff King
2016-07-23 10:15   ` Jakub Narębski
2016-07-26 18:47     ` Jeff King
2016-07-27 12:35       ` Jakub Narębski
2016-07-27 13:44         ` [PATCH v3 " Jeff King
2016-07-27 19:49           ` Junio C Hamano
2016-07-27 19:57             ` Jeff King [this message]
2016-07-27 20:11               ` Junio C Hamano
2016-07-27 20:16                 ` Jeff King
2016-07-27 20:17                   ` Junio C Hamano
2016-07-22 19:51 ` [PATCH v2 6/6] date: add "unix" format 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160727195703.GA8141@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=tytso@mit.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).