From: Miklos Vajna Date: Wed, 02 Apr 2008 20:45:24 GMT Subject: Re: [PATCH 3/3] contrib/hooks: add an example pre-auto-gc hook Message-ID: <20080402204524.GZ3264@genesis.frugalware.org> In-Reply-To: <7vfxu4808c.fsf@gitster.siamese.dyndns.org> On Wed, Apr 02, 2008 at 01:34:27PM -0700, Junio C Hamano wrote: > If it is "can't tell", then it is "can't tell". Don't you want to err on > the safe side? First, I think "can't tell" almost never means "on battery" these days, since the necessary kernel support is enabled by the distro's hotplug scripts. Second, that's what we do in case we fail to read for example /sys/class/power_supply/AC/online: just silently redirect the error to /dev/null and assume we are not on battery. I would say it does not worth doing so, but feel free to kick me if it's a must. :)