From: Junio C Hamano Date: Wed, 02 Apr 2008 19:49:32 GMT Subject: Re: [PATCH 3/3] contrib/hooks: add an example pre-auto-gc hook Message-ID: <7vk5jg82b7.fsf@gitster.siamese.dyndns.org> In-Reply-To: <502492c60a58bdf409b3f6400da25f4a9a97463d.1207164676.git.vmiklos@frugalware.org> Miklos Vajna writes: > +if test -x /sbin/on_ac_power && /sbin/on_ac_power > +then > + /sbin/on_ac_power > + if [ $? = 1 ]; then > + exit 0 > + fi Shouldn't the above be: if test -x /sbin/on_ac_power && /sbin/on_ac_power then exit 0 That is, you checked if you have the command to check on-ac-power-ness, and the command says yes, so you happily let "gc --auto" do its thing.