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

Re: Big repo not shrinking on repack or gc?

From
Bryan Turner <bturner@atlassian.com>
Date
Jan 15, 2015, 07:05 UTC
Message-ID
<CAGyf7-HMsBnim5yoOgyNJ2=HNpnW8ftvitarMc6UO-zTLfQkBA@mail.gmail.com>
In-Reply-To
<20150115063806.GH13247@inner.h.apk.li>
On Thu, Jan 15, 2015 at 5:38 PM, Andreas Krey <a.krey@gmx.de> wrote:
Show 30 quoted lines
> On Thu, 15 Jan 2015 12:23:00 +0000, Bryan Turner wrote:
> ...
>> > Guess in the dark: "ls -l .git/objects/pack"
>> > Do you see any .keep files?
>
> Lots of. :-(
>
>> I'm one of the Stash developers and just noticed this thread. If the
>> repository in question has been forked via Stash there likely _will_
>> be .keep files. Stash uses alternates for forks, so it's possible, by
>> deleting those kept packs and pruning objects (which you've already
>> done I see) that you will corrupt, or have already corrupted, some
>> number of the forks.
>
> There are a few forks in this stash instance, but the repository in
> question is neither the source nor the destination of any.
>
> So, git seems to be mostly out of the equation now (gc and repack
> apparently doing what they are supposed to do), and the question
> moves to 'how can stash let such a repo grow to that size'.
>
>
>> (At the moment Stash packs "garbage" into a "dead
>> pack" which it flags with a .keep, to ensure forks don't lose access
>> to objects that once existed upstream that they still reference.)
>
> Does it do so in any case even if there is no actual fork? That would
> explain a lot - we are daily (force-)pushing new commit in there (and
> potentially big ones) that become garbage the next day, and should
> be cleaned up rather fast.

No, Stash will only do that in a repository which has been forked. In any non-forked repository, Stash does not interact with garbage collection in any way. Auto GC is left enabled, and all pruning settings are left at their defaults. The default pruning interval is two weeks, so if your development approach is rebase-heavy you may need to adjust them.

What are the contents of some of those .keep files? If they're written by Stash they contain a message saying so. ("GENERATED BY ATLASSIAN STASH - DO NOT REMOVE")

Show 11 quoted lines
>
> (We're pulling them into another non-stash repo for longer-term keeping -
> these are backups of dev repos in the form of git stash commits including
> untracked files.)
>
> Andreas
>
> --
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800
Previous: Andreas KreyNext: Andreas Krey
Message 9 of 11 in “Big repo not shrinking on repack or gc?”
  1. Andreas KreyJan 14, 2015
  2. Jeff KingJan 14, 2015
  3. Andreas KreyJan 14, 2015
  4. Andreas KreyJan 14, 2015
  5. Andreas KreyJan 14, 2015
  6. Junio C HamanoJan 14, 2015
  7. Bryan TurnerJan 15, 2015
  8. Andreas KreyJan 15, 2015
  9. Bryan TurnerJan 15, 2015
  10. Andreas KreyJan 15, 2015
  11. Bryan TurnerJan 15, 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.