In bug #890543, you wrote:
> On a workstation system, on_ac_power gives 255 as exit code because it
> was unable to determine the power source.

The man page says:
# EXIT STATUS
#       0 (true)  System is on mains power
#       1 (false) System is not on mains power
#       255 (false)    Power status could not be determined

so 255 on a desktop is expected.  There's nothing that would tell the system
where its power comes from.  (Unless you have an UPS and connect its control
link.)

It's the correct answer: the kernel can't tell a desktop from a laptop with
a battery with no supported driver.

> This would in turn make git think the system is on battery, and refuse
> to automatically perform garbage collection.

Then it's a bug in git.

The only reference to on_ac_power I see is contrib/hooks/pre-auto-gc-battery
which takes any non-zero result as "on battery".  You're right that on a
machine with no relevant sensor, garbage collection should still run.

> The proposed patch will tell the caller that AC power is present when
> there is no battery.

The patch would cause a regression: it would fold current three-state answer
into two-state, and there are use cases where "unknown" is not same as
"mains".

Instead, let's patch this in git.git.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ A dumb species has no way to open a tuna can.
⢿⡄⠘⠷⠚⠋⠀ A smart species invents a can opener.
⠈⠳⣄⠀⠀⠀⠀ A master species delegates.

Reply via email to