Re: [PATCH] Invoke "gc --auto" from git commit
Johannes Schindelin wrote:
> On Tue, 25 Nov 2008, Jean-Luc Herren wrote:
>> This feature was lost during the port of git commit to C.
>
> See http://article.gmane.org/gmane.comp.version-control.git/82125
Oh, I missed that. But then the only commands ever invoking git gc --auto would be git rebase -i, git merge, git svn and git am. I don't know if some people have repositories where they never use any of those, but I certainly have repositories where I only ever use git rebase -i and never any of the other. 'git commit' is something everyone is bound to use and thus it would be the best place for running 'git gc --auto'.
As for the performance impact, on my machine 'git gc --auto' runs 500 times per second in a loop on the git repository (it won't call the hook unless repacking is necessary). I suppose any script calling git commit in a loop would do substantially more work than git gc --auto itself. And if that bit of performance really matters, it could be invoked by git commit only if (rand() % 20 == 0).
My two cents anyway.
jlh