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

Re: git gc --auto yelling at users where a repo legitimately has >6700 loose objects

From
Jeff King <peff@peff.net>
Date
Jan 13, 2018, 10:07 UTC
Message-ID
<20180113100734.GA30698@sigill.intra.peff.net>
In-Reply-To
<87d12f9lx1.fsf@evledraar.gmail.com>
On Fri, Jan 12, 2018 at 03:44:26PM +0100, Ævar Arnfjörð Bjarmason wrote:
Show 8 quoted lines
> More generally, the reason we even have the 2 week limit is to pick a
> good trade-off between performance and not losing someone's work that
> they e.g. "git add"-ed but never committed.
> 
> I'm suggesting (but don't know if this is worth it, especially given
> Jeff's comments) that one smarter approach might be to track where the
> objects came from (e.g. by keeping reflogs for deleted upstream branches
> for $expiry_time).

I don't think reflogs would help here. We consider reflog'd objects as "reachable". So you'd still have something like this:

  1. You delete a branch. Reflog still mentions its commits.
  2. You run gc (or auto-gc). Those objects are still retained in the
     main pack due to the reachability rule. This may happen multiple
     times, and each time their "timestamp" is updated, because it is
     really just the timestamp of the containing pack.
  3. 30 days later, you run another gc. The reflog is now past its
     expiration and is deleted, and now those objects are unreachable.
     This gc turns them loose, but it still considers them "recent" as
     of the last gc you ran, due to the timestamp thing above.
-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Jeff King
Message 5 of 9 in “git gc --auto yelling at users where a repo legitimately has >6700 loose objects”
  1. Ævar Arnfjörð BjarmasonJan 11, 2018
  2. Duy NguyenJan 12, 2018
  3. Duy NguyenJan 12, 2018
  4. Ævar Arnfjörð BjarmasonJan 12, 2018
  5. Jeff KingJan 13, 2018
  6. Jeff KingJan 12, 2018
  7. Duy NguyenJan 12, 2018
  8. Jeff KingJan 13, 2018
  9. Ævar Arnfjörð BjarmasonFeb 8, 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.