From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: darcy via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, darcy <acednes@gmail.com>
Subject: Re: [PATCH] fix: prevent date underflow when using positive timezone offset
Date: Tue, 28 May 2024 10:06:24 -0700 [thread overview]
Message-ID: <xmqqmso96f3j.fsf@gitster.g> (raw)
In-Reply-To: <ZlXkvEeR-PgZMitx@tanuki> (Patrick Steinhardt's message of "Tue, 28 May 2024 16:05:48 +0200")
Patrick Steinhardt <ps@pks.im> writes:
> On Mon, May 27, 2024 at 09:17:06AM +0000, darcy via GitGitGadget wrote:
>> From: darcy <acednes@gmail.com>
>
> The commit message should start with the subsystem that you're touching,
> which in this case would be "date", e.g.:
>
> date: detect underflow when parsing dates with positive timezone offset
>
>> Overriding the date of a commit to be `1970-01-01` with a large enough
>> timezone for the equivalent GMT time to before 1970 is no longer
>> accepted.
>
> Okay.
"is no longer accepted" made me read the sentence three times to get
what the author wants to say. Initially I thought the author wanted
to report a regression where we used to accept but with a recent
change we stopped accepting.
In our convention, we present the status quo, point out why it is
awkard/incorrect/bad, and then propose a new behaviour.
Overriding ... before 1970 BEHAVES THIS WAY.
This leads to BAD BEHAVIOUR FOR SUCH AND SUCH REASONS.
Instead check the timezone offset and fail if the resulting time
becomes before the epoch, "1970-01-01T00:00:00Z", when parsing.
with the blanks filled in appropriately would have been much easier
to see.
>> Example: `GIT_COMMITTER_DATE='1970-01-01T00:00:00+10' git commit` would
>> previously be accepted, only to unexpectedly fail in other parts of the
>> code, such as `git push`. The timestamp is now checked against postitive
>> timezone values.
>
> How exactly does the failure look like before and after?
Yes, good question.
>> Signed-off-by: darcy <acednes@gmail.com>
>> ---
I cannot offhand tell if Documentation/SubmittingPatches:real-name
is followed here or ignored, so just to double check...
Everything else in your review made sense to me. I guess that
checking for tm_hour is assuming that TZ offset should always come
before the values necessary to compute the timestamp comes, but it
smells like an unwarranted assumption and not explaining the change
in the proposed log message is a bad sign.
Thanks.
next prev parent reply other threads:[~2024-05-28 17:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 9:17 [PATCH] fix: prevent date underflow when using positive timezone offset darcy via GitGitGadget
2024-05-28 14:05 ` Patrick Steinhardt
2024-05-28 14:49 ` Phillip Wood
2024-05-28 17:06 ` Junio C Hamano [this message]
2024-06-02 23:06 ` [PATCH v2] date: detect underflow when parsing dates with " darcy via GitGitGadget
2024-06-03 11:13 ` Junio C Hamano
2024-06-03 11:44 ` darcy
2024-06-03 14:13 ` Phillip Wood
2024-06-04 8:48 ` darcy
2024-06-04 9:33 ` Jeff King
2024-06-05 6:52 ` darcy
2024-06-05 13:10 ` Phillip Wood
2024-06-05 17:27 ` Junio C Hamano
2024-06-06 4:56 ` darcy
2024-06-07 0:17 ` [PATCH v3] date: detect underflow/overflow when parsing dates with " darcy via GitGitGadget
2024-06-07 17:40 ` Junio C Hamano
2024-06-08 18:58 ` Junio C Hamano
2024-06-14 1:20 ` Junio C Hamano
2024-06-15 11:47 ` Karthik Nayak
2024-06-11 23:30 ` Junio C Hamano
2024-06-11 23:49 ` rsbecker
2024-06-11 23:52 ` Junio C Hamano
2024-06-25 23:12 ` [PATCH v4 0/2] Darcy's "date underflow fix" topic, final reroll Junio C Hamano
2024-06-25 23:12 ` [PATCH v4 1/2] t0006: simplify prerequisites Junio C Hamano
2024-06-25 23:30 ` Eric Sunshine
2024-06-26 0:04 ` Junio C Hamano
2024-06-25 23:12 ` [PATCH v4 2/2] date: detect underflow/overflow when parsing dates with timezone offset Junio C Hamano
2024-06-26 15:21 ` [PATCH v4 0/2] Darcy's "date underflow fix" topic, final reroll Phillip Wood
2024-06-26 18:32 ` Junio C Hamano
2024-06-12 9:07 ` [PATCH v3] date: detect underflow/overflow when parsing dates with timezone offset Phillip Wood
2024-06-12 9:49 ` Karthik Nayak
2024-06-13 13:31 ` Phillip Wood
2024-06-13 16:16 ` Junio C Hamano
2024-06-14 20:09 ` Karthik Nayak
2024-06-14 21:02 ` Junio C Hamano
2024-06-15 11:49 ` Karthik Nayak
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=xmqqmso96f3j.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=acednes@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=ps@pks.im \
/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).