From: Johannes Sixt Date: Fri, 04 Apr 2008 06:34:39 GMT Subject: Re: tests for pre-auto-gc hook Message-ID: <47F5CBFF.1080807@viscovery.net> In-Reply-To: <20080403212656.GJ11574@genesis.frugalware.org> Miklos Vajna schrieb: > 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 > ---- Avoid 'seq'; it is not available everywhere. To avoid spawning 500 processes, you could create a pack file from the files using fastimport, then unpack that for each test case. But you must move the pack out of .git/objects/pack before unpacking, otherwise it won't unpack anything. -- Hannes