Re: We should add a "git gc --auto" after "git clone" due to commit graph
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 3, 2018, 16:45 UTC
- Message-ID
- <CACsJy8Ap0s-8NSM3MW9TtRifUUod0bDhGnzaeJuTSzXjmJA=pQ@mail.gmail.com>
- In-Reply-To
- <87tvm3go42.fsf@evledraar.gmail.com>
On Wed, Oct 3, 2018 at 3:23 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 11 quoted lines
> > Don't have time to patch this now, but thought I'd send a note / RFC > about this. > > Now that we have the commit graph it's nice to be able to set > e.g. core.commitGraph=true & gc.writeCommitGraph=true in ~/.gitconfig or > /etc/gitconfig to apply them to all repos. > > But when I clone e.g. linux.git stuff like 'tag --contains' will be slow > until whenever my first "gc" kicks in, which may be quite some time if > I'm just using it passively.
Since you have core.hooksPath, you can already force gc (even in detached mode) in post-checkout hook. I'm adding a new "post-init-repo" hook to allow more customization right after clone or init-db which may also be useful for other things than gc.
-- Duy