git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git gc "--prune=now" semantics considered harmful

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 1, 2018, 11:07 UTC
Message-ID
<CA+55aFz5cwZa_PWMV2aGv0TGBpBz8OUB-dPvdwv4ouQs1t1mzA@mail.gmail.com>
In-Reply-To
<20180601070456.GB15578@sigill.intra.peff.net>
On Fri, Jun 1, 2018 at 2:04 AM Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
>
> 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
Previous: Jeff King
Message 5 of 5 in “[RFC] git gc "--prune=now" semantics considered harmful”
  1. Linus TorvaldsMay 26, 2018
  2. Junio C HamanoMay 26, 2018
  3. Linus TorvaldsMay 27, 2018
  4. Jeff KingJun 1, 2018
  5. Linus TorvaldsJun 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.