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

Re: [RFC PATCH] repack: make repack -a equivalent to repack -A and drop previous -a behavior

From
Theodore Tso <tytso@mit.edu>
Date
Nov 14, 2008, 02:22 UTC
Message-ID
<20081114022231.GB25117@mit.edu>
In-Reply-To
<jKWdt94ZxgNW0UAgUUW-qjTtpWohpQXMfvw-AUmOXND8SD5yFw0N8w@cipher.nrlssc.navy.mil>
On Thu, Nov 13, 2008 at 06:53:29PM -0600, Brandon Casey wrote:
Show 12 quoted lines
> > -Ad is nice regarding it's safety-net value, but eg. after a large
> > filter-branch run, when refs/original and the reflogs have been cleaned,
> > you just want to get rid of all those old unreachable objects,
> > immediately. For example after importing and massaging some large
> > history from SVN, the -Ad behaviour is definitely _not_ what I want
> > there. Writing a few thousand loose objects just to prune them is just a
> > waste of time.
> 
> hmm. That's a good point. Even though I think it is likely that the thousand
> loose objects that are written will be small commit objects and not blobs,
> this use case may be enough to trump the safety benefit provided by the
> proposed change.

The problem is even small commit objects take a full 4k (or whatever your filesystem block size is) when they are ejected as loose objects. As a result, the current "git gc" defaults can end up requiring far *more* disk space than before, certainly while it is running, and sometimes even after the "git gc" completes. (I then end up running "git prune" to complete deletion of the ejected objects.)

Sometimes this gets so annoying that I'll run the individual commands run by git-gc by hand, except I use git repack -ad instead of git repack -A. If we are going to get rid of the distinction between git repack -a and git repack -A, perhaps there can be a config option to force the immediate ejection of the unreachable objects, instead of creating loose objects?

If the goal is safety, it would be nice if git repack could create a separate pack that only contained unreachable objects, and then have git prune be able to remove a pack if it only contains unreachable objects.

						- Ted
Previous: Björn Steinbrink
Message 7 of 7 in “repack: make repack -a equivalent to repack -A and drop previous -a behavior”
  1. repack: make repack -a equivalent to repack -A and drop previous -a behaviorBrandon Casey, Nov 13, 2008
  2. Björn SteinbrinkNov 14, 2008
  3. Brandon CaseyNov 14, 2008
  4. Björn SteinbrinkNov 14, 2008
  5. Brandon CaseyNov 14, 2008
  6. Björn SteinbrinkNov 14, 2008
  7. Theodore TsoNov 14, 2008

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.