From: Felix Natter <fnatter@gmx.net>
To: git@vger.kernel.org
Subject: Re: git repack vs git gc --aggressive
Date: Fri, 10 Aug 2012 21:09:38 +0200 [thread overview]
Message-ID: <87ehnewolp.fsf@bitburger.home.felix> (raw)
In-Reply-To: 7vvcguv7y2.fsf@alter.siamese.dyndns.org
Junio C Hamano <gitster@pobox.com> writes:
> Jeff King <peff@peff.net> writes:
>
>> So the packing parameters are the same these days for either method.
>> Note that "git gc --aggressive" will also use "-f" to recompute all
>> deltas. This is more expensive, but gives git more flexibility if the
>> old deltas were sub-optimal (typically, this is the case if the existing
>> pack was generated by fast-import, which favors speed of import versus
>> coming up with an optimal storage pattern).
>
> Also your fetch often results in storing the pack received from the
> other end straight to your local repository (with necessary objects
> to complete the pack the other end did not send appended at the
> end). If the server side hasn't been packed with "-f", you will
> inherit the badness until you repack with "-f".
>
>> Of course, every workload is different. One can develop pathological
>> cases where --depth=500 saves a lot of space. But it's unlikely that it
>> is the case for a normal repository. You can always try both and see the
>> result.
>
> For a dataset where ridiculously large depth really is a win, these
> objects would have to be reasonably large and cost of expanding the
> base and then applying hundreds of delta to recover one object may
> not be negligible. The user should consider if he is willing to pay
> the price every time he does a local Git operation.
>
>> In fact, I'd also test how just "git gc" behaves versus "git gc
>> --aggressive" for your repo. The former is much less expensive to run.
>> You really shouldn't need to be running "--aggressive" all the time, so
>> if you are looking at doing a nightly repack or similar, just "git gc"
>> is probably fine.
Thank you both very much for your answers!
I have a few questions about this:
> As I am coming from "large depth is harmful" school, I would
> recommend
>
> - "git repack -a -d -f" with large "--window" with reasonably short
> "--depth" once,
So something like --depth=250 and --window=500?
> and mark the result with .keep;
I guess you refer to a toplevel '.keep' file. But what does
that do (sorry, couldn't find anything on google)?
> - "git repack -a -d -f" once every several weeks; and
>
> - "git gc" or "git repack" (without any other options) daily.
>
> and ignore "--aggressive" entirely.
One more question: I use bzr fast-export | git fast-import to import
branches from bzr:
bzr fast-export --marks=$MARKS_BZR --git-branch="$BRANCHNAME" "$BZR_FREEPLANE_REPO/$BRANCHNAME/" | \
git fast-import --import-marks=$MARKS_GIT --export-marks=$MARKS_GIT
Will those marks files (which remember which commits are already there in
the git repo) also work after I have done git repack / git gc?
In other words, can I import bzr-branches after I have run git repack /
git gc on the repo?
Thank you!
--
Felix Natter
next prev parent reply other threads:[~2012-08-10 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-07 18:22 git repack vs git gc --aggressive Felix Natter
2012-08-07 18:44 ` Jeff King
2012-08-07 19:05 ` Junio C Hamano
2012-08-10 19:09 ` Felix Natter [this message]
2012-08-10 20:09 ` Junio C Hamano
2012-08-13 14:20 ` Marc Branchaud
2012-08-13 17:19 ` Junio C Hamano
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=87ehnewolp.fsf@bitburger.home.felix \
--to=fnatter@gmx.net \
--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;
as well as URLs for NNTP newsgroup(s).