Re: [PATCH] git gc --auto: defer on battery
- From
Miklos Vajna <vmiklos@frugalware.org>
- Date
- Mar 30, 2008, 23:53 UTC
- Message-ID
- <20080330235322.GV11666@genesis>
- In-Reply-To
- <alpine.LSU.1.00.0803310137090.18259@racer.site>
On Mon, Mar 31, 2008 at 01:41:18AM +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> And what about system dependency? I mean, if at all, this stuff belongs > to compat/. Definitely not into builtin-gc.c. And yes, that means that > you should not call the function is_on_battery() blindly, but _only_ if > defer_on_battery is set.
Hm, should I just move it to there or should there be some kind of check? Currently it just tries to open that file under /sys and if fails, it just assumes we are not on battery. I think that's the expected behaviour on systems not having a /sys filesystem.
As far as I see, compat/ is for functions which are available on some systems but not an all ones. Obviously is_on_battery() won't be available on any system. :)
The other issues (I hope) are fixed in the second patch.