From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jay Soffian <jaysoffian@gmail.com>, Miles Bader <miles@gnu.org>,
git@vger.kernel.org
Subject: Re: orthogonal cases of log --date option
Date: Thu, 05 Mar 2009 14:21:27 -0800 [thread overview]
Message-ID: <7vy6vjy5js.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20090305211120.GB20157@coredump.intra.peff.net> (Jeff King's message of "Thu, 5 Mar 2009 16:11:20 -0500")
Jeff King <peff@peff.net> writes:
> Yep, it is more invasive. But I consider it more maintainable in the
> long run.
Why do you think it is more confusing to ask "--date=local --date=iso"
than asking "--local-time --date=iso"? If the patch under discussion were
not mine, I would have said that --date=local that flips the "lie about
timezone" bit and tells us to use the "default" format is a brilliant and
elegant solution.
I honestly do not see the point of what you are proposing to make
"selector" and "format" independent; unless you are shooting for
"--use-tz=Indian/Christmas --date=iso", that is.
The "--use-tz=zonename" might make some sense. The required change would
look more like:
(1) Introduce:
const char *force_output_tz;
that defaults to NULL;
(2) Option parser for --use-tz=Indian/Christmas would store
arg+9 to force_output_tz;
(3) Option parser for --date=local would set the date format to
"default", and store "localtime" to force_output_tz. We discard
DATE_LOCAL enum.
(4) In show_date(), instead of
if (mode == DATE_LOCAL)
tz = local_tzoffset(time);
you'd do:
if (forced_output_tz)
tz = zonename_to_tzoffset(time, force_output_tz);
zonename_to_tzoffset() would look up the zoneinfo database and
compute the offset in our internal (hour*100+min) format.
But I do not think that is what you were proposing.
next prev parent reply other threads:[~2009-03-05 22:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 8:18 orthogonal cases of log --date option Miles Bader
2009-03-03 8:34 ` Jeff King
2009-03-03 8:45 ` Junio C Hamano
2009-03-05 10:43 ` Jeff King
2009-03-05 21:04 ` Jay Soffian
2009-03-05 21:11 ` Jeff King
2009-03-05 22:21 ` Junio C Hamano [this message]
2009-03-06 5:23 ` Jeff King
2009-03-06 6:50 ` Junio C Hamano
2009-03-06 6:58 ` Jay Soffian
2009-03-06 8:02 ` Junio C Hamano
2009-03-06 8:31 ` Jay Soffian
2009-03-06 8:58 ` Junio C Hamano
2009-03-06 12:12 ` Jeff King
2009-03-06 12:10 ` Jeff King
2009-03-06 12:09 ` Jeff King
2009-03-06 1:47 ` Miles Bader
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=7vy6vjy5js.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jaysoffian@gmail.com \
--cc=miles@gnu.org \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.