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

Re: git pull & git gc

From
Jeff King <peff@peff.net>
Date
Mar 19, 2015, 04:34 UTC
Message-ID
<20150319043437.GA30331@peff.net>
In-Reply-To
<CACsJy8B3zyf7mCigQSGXOKLcR9s3=VKkxEe4PuSraS6qb-rjcA@mail.gmail.com>
On Thu, Mar 19, 2015 at 11:29:57AM +0700, Duy Nguyen wrote:
Show 11 quoted lines
> > That omits the "N objects left over" information. Which I think may be
> > useful, because otherwise the rule is basically "don't do another gc at
> > all for X time units". That's OK for most use, but it has its own corner
> > cases.
> 
> True. But saving "N objects left over" in a file also has a corner
> case. If the user "prune --expire=now" manually, the next 'gc --auto'
> still thinks we have that many leftovers and keeps delaying gc for
> some more time. Unless we make 'prune' (or any other commands that
> delete leftovers) to also delete this file. Yeah maybe saving this
> info in a file will work.

I assumed that the user would not run prune manually, but would run "git gc --prune=now". And yeah, definitely any time gc runs, it should update the file (if there are fewer than `gc.auto` objects, I think it could just delete the file).

We could also apply that rule any run of "git prune", but my mental model is that "git gc" is the magical porcelain that will do this stuff for you, and "git prune" is the plumbing that users shouldn't need to call themselves. I don't know if that model is shared by users, though. :)

-Peff
Previous: Duy NguyenNext: Duy Nguyen
Message 18 of 21 in “git pull & git gc”
  1. Дилян ПалаузовMar 18, 2015
  2. Duy NguyenMar 18, 2015
  3. Дилян ПалаузовMar 18, 2015
  4. Duy NguyenMar 18, 2015
  5. Duy NguyenMar 18, 2015
  6. John KeepingMar 18, 2015
  7. Jeff KingMar 18, 2015
  8. Duy NguyenMar 19, 2015
  9. Jeff KingMar 19, 2015
  10. Mike HommeyMar 19, 2015
  11. Jeff KingMar 19, 2015
  12. Mike HommeyMar 19, 2015
  13. Junio C HamanoMar 19, 2015
  14. Jeff KingMar 19, 2015
  15. Duy NguyenMar 19, 2015
  16. Jeff KingMar 19, 2015
  17. Duy NguyenMar 19, 2015
  18. Jeff KingMar 19, 2015
  19. Duy NguyenMar 19, 2015
  20. Дилян ПалаузовMar 18, 2015
  21. Jeff KingMar 18, 2015

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.