From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: John Keeping <john@keeping.me.uk>, git@vger.kernel.org
Subject: Re: [RFC/PATCH] date: allow any format to display local time
Date: Mon, 31 Aug 2015 14:56:57 -0400 [thread overview]
Message-ID: <20150831185657.GC20555@sigill.intra.peff.net> (raw)
In-Reply-To: <20150831185018.GA20555@sigill.intra.peff.net>
On Mon, Aug 31, 2015 at 02:50:18PM -0400, Jeff King wrote:
> diff --git a/fast-import.c b/fast-import.c
> index 6c7c3c9..b19a1b5 100644
> --- a/fast-import.c
> +++ b/fast-import.c
> @@ -412,6 +412,10 @@ static void write_crash_report(const char *err)
> struct branch *b;
> unsigned long lu;
> struct recent_command *rc;
> + struct date_mode dm;
> +
> + dm.type = DATE_NORMAL;
> + dm.local = 1;
>
> if (!rpt) {
> error("can't write crash report %s: %s", loc, strerror(errno));
> @@ -424,7 +428,7 @@ static void write_crash_report(const char *err)
> fprintf(rpt, "fast-import crash report:\n");
> fprintf(rpt, " fast-import process: %"PRIuMAX"\n", (uintmax_t) getpid());
> fprintf(rpt, " parent process : %"PRIuMAX"\n", (uintmax_t) getppid());
> - fprintf(rpt, " at %s\n", show_date(time(NULL), 0, DATE_MODE(LOCAL)));
> + fprintf(rpt, " at %s\n", show_date(time(NULL), 0, &dm));
> fputc('\n', rpt);
>
> fputs("fatal: ", rpt);
I also considered just switching this hunk to another format. I doubt
that anybody cares what format the fast-import crash-report timestamp is
in. And in fact LOCAL is kind of a bad choice. Using the user's timezone
is fine, but _omitting_ the timezone in a crash report seems like a
recipe for confusion. Probably iso8601-local would be saner.
-Peff
next prev parent reply other threads:[~2015-08-31 18:57 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-30 13:54 [RFC/PATCH] date: allow any format to display local time John Keeping
2015-08-31 17:28 ` Junio C Hamano
2015-08-31 18:50 ` Jeff King
2015-08-31 18:56 ` Jeff King [this message]
2015-08-31 19:57 ` Junio C Hamano
2015-08-31 20:00 ` John Keeping
2015-08-31 20:44 ` Jeff King
2015-08-31 20:47 ` [PATCH 1/2] fast-import: switch crash-report date to iso8601 Jeff King
2015-08-31 20:48 ` [PATCH 2/2] date: make "local" orthogonal to date format Jeff King
2015-08-31 21:27 ` John Keeping
2015-08-31 21:33 ` Jeff King
2015-08-31 22:05 ` Jeff King
2015-09-01 8:37 ` John Keeping
2015-09-01 21:55 ` [PATCH v2 0/6] Make " John Keeping
2015-09-01 21:55 ` [PATCH v2 1/6] fast-import: switch crash-report date to iso8601 John Keeping
2015-09-01 21:55 ` [PATCH v2 2/6] date: make "local" orthogonal to date format John Keeping
2015-09-01 22:16 ` Junio C Hamano
2015-09-01 22:25 ` Jeff King
2015-09-01 22:33 ` John Keeping
2015-09-01 22:39 ` Jeff King
2015-09-01 22:41 ` Junio C Hamano
2015-09-02 17:36 ` Junio C Hamano
2015-09-01 21:55 ` [PATCH v2 3/6] t6300: introduce test_date() helper John Keeping
2015-09-01 22:19 ` Junio C Hamano
2015-09-01 22:26 ` Eric Sunshine
2015-09-01 22:31 ` Jeff King
2015-09-01 22:40 ` John Keeping
2015-09-01 22:41 ` Jeff King
2015-09-01 21:55 ` [PATCH v2 4/6] t6300: make UTC and local dates different John Keeping
2015-09-01 21:55 ` [PATCH v2 5/6] t6300: add test for "raw" date format John Keeping
2015-09-01 21:55 ` [PATCH v2 6/6] t6300: add tests for "-local" date formats John Keeping
2015-09-01 22:44 ` [PATCH v2 0/6] Make "local" orthogonal to date format Jeff King
2015-09-02 7:48 ` John Keeping
2015-09-02 8:05 ` Jeff King
2015-09-02 15:16 ` Junio C Hamano
2015-09-02 19:49 ` John Keeping
2015-09-02 20:11 ` Junio C Hamano
2015-09-02 20:21 ` John Keeping
2015-09-02 20:29 ` Junio C Hamano
2015-09-02 21:27 ` Jeff King
2015-09-03 21:48 ` [PATCH v3 00/11] " John Keeping
2015-09-03 21:48 ` [PATCH v3 01/11] Documentation/blame-options: don't list date formats John Keeping
2015-09-03 21:48 ` [PATCH v3 02/11] Documentation/config: " John Keeping
2015-09-03 21:48 ` [PATCH v3 03/11] Documentation/git-for-each-ref: " John Keeping
2015-09-03 21:48 ` [PATCH v3 04/11] Documentation/rev-list: " John Keeping
2015-09-03 22:36 ` Junio C Hamano
2015-09-03 21:48 ` [PATCH v3 05/11] fast-import: switch crash-report date to iso8601 John Keeping
2015-09-03 21:48 ` [PATCH v3 06/11] t6300: introduce test_date() helper John Keeping
2015-09-03 21:48 ` [PATCH v3 07/11] t6300: add test for "raw" date format John Keeping
2015-09-03 21:48 ` [PATCH v3 08/11] date: check for "local" before anything else John Keeping
2015-09-03 22:45 ` Junio C Hamano
2015-09-03 21:48 ` [PATCH v3 09/11] date: make "local" orthogonal to date format John Keeping
2015-09-03 21:49 ` [PATCH v3 10/11] t6300: make UTC and local dates different John Keeping
2015-09-03 21:49 ` [PATCH v3 11/11] t6300: add tests for "-local" date formats John Keeping
2015-09-08 7:53 ` [PATCH v3 00/11] Make "local" orthogonal to date format Jeff King
2015-09-02 17:41 ` [PATCH 2/2] date: make " Junio C Hamano
2015-09-02 21:30 ` Jeff King
2015-09-02 22:07 ` John Keeping
2015-09-03 15:54 ` Junio C Hamano
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=20150831185657.GC20555@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=john@keeping.me.uk \
/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).