From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC] git gc "--prune=now" semantics considered harmful
Date: Fri, 1 Jun 2018 06:07:28 -0500 [thread overview]
Message-ID: <CA+55aFz5cwZa_PWMV2aGv0TGBpBz8OUB-dPvdwv4ouQs1t1mzA@mail.gmail.com> (raw)
In-Reply-To: <20180601070456.GB15578@sigill.intra.peff.net>
On Fri, Jun 1, 2018 at 2:04 AM Jeff King <peff@peff.net> wrote:
>
> We'd also accept relative times like "5.minutes.ago" (in fact, the
> default is a relative 2.weeks.ago, though it's long enough that the
> difference between "2 weeks" and "2 weeks plus 5 minutes" may not matter
> much). So we probably ought to just normalize _everything_ without even
> bothering to match "now". It's a noop for non-relative times, but that's
> OK.
Heh. That's what I tried to do at first.
It's surprisingly hard.
You can't normalize it as a date, because we have a few times that
aren't expressible as dates because they are just the maximum value
(ie "all").
And then I tried to just express it just as a standard numerical
value, which we accept on input. But we *only* accept that if it's
more than eight digits.
And regardless, you need to special-case "now", since
parse_expiry_date() special cases it.
Or you'd need to just make another version of parse_expiry_date() entirely.
End result: I only special-cased "now".
> There are still possibilities for a race, even with the grace period.
Agreed. But you *really* have to work at it.
Linus
prev parent reply other threads:[~2018-06-01 11:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-26 21:49 [RFC] git gc "--prune=now" semantics considered harmful Linus Torvalds
2018-05-26 23:31 ` Junio C Hamano
2018-05-27 1:27 ` Linus Torvalds
2018-06-01 7:04 ` Jeff King
2018-06-01 11:07 ` Linus Torvalds [this message]
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=CA+55aFz5cwZa_PWMV2aGv0TGBpBz8OUB-dPvdwv4ouQs1t1mzA@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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 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).