From: Miklos Vajna Date: Thu, 03 Apr 2008 21:26:56 GMT Subject: tests for pre-auto-gc hook (WAS: Re: [PATCH 3/3] contrib/hooks: add an example pre-auto-gc hook) Message-ID: <20080403212656.GJ11574@genesis.frugalware.org> In-Reply-To: <20080402204524.GZ3264@genesis.frugalware.org> Hi, I wanted to create a test like t7503-pre-commit-hook.sh for pre-auto-gc but actually I'm not sure how to trigger git gc --auto to do something. Here is what I managed to do so far: ---- git init git config gc.auto 1 for i in `seq 1 500`; do echo $i >file; git add file; done git commit -m init ---- After this, 'git gc --auto' seem to print the 'Auto packing your repository for optimum performance.' message, but the return code is still 0, just like if it did not do anything. So all what I found is that the .git/objects/pack/ directory is empty in a new repo, and if git gc --auto did something, it won't be empty but: 1) this isn't the proper way I'm sure. 2) if I want to do it from a test, then I would need to create the repo from scratch again and again, which is quite dirty. Does anyone have better ideas? Thanks