Git development
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Brandon Casey <casey@nrlssc.navy.mil>
Cc: "Björn Steinbrink" <B.Steinbrink@gmx.de>, git@vger.kernel.org
Subject: Re: [RFC PATCH] repack: make repack -a equivalent to repack -A and drop previous -a behavior
Date: Thu, 13 Nov 2008 21:22:31 -0500	[thread overview]
Message-ID: <20081114022231.GB25117@mit.edu> (raw)
In-Reply-To: <jKWdt94ZxgNW0UAgUUW-qjTtpWohpQXMfvw-AUmOXND8SD5yFw0N8w@cipher.nrlssc.navy.mil>

On Thu, Nov 13, 2008 at 06:53:29PM -0600, Brandon Casey wrote:
> > -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

  parent reply	other threads:[~2008-11-14  2:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 23:22 [RFC PATCH] repack: make repack -a equivalent to repack -A and drop previous -a behavior Brandon Casey
2008-11-14  0:02 ` Björn Steinbrink
2008-11-14  0:53   ` Brandon Casey
2008-11-14  1:25     ` Björn Steinbrink
2008-11-14  1:36       ` Brandon Casey
2008-11-14  1:48         ` Björn Steinbrink
2008-11-14  2:22     ` Theodore Tso [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-11-13 23:20 Brandon Casey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081114022231.GB25117@mit.edu \
    --to=tytso@mit.edu \
    --cc=B.Steinbrink@gmx.de \
    --cc=casey@nrlssc.navy.mil \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox