Re: [PATCH] Fix power checking on OS X
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 12, 2015, 14:54 UTC
- Message-ID
- <xmqqr3phdlj3.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CACvVhd7sKiz+gTDY_RVjFf1i3Rt2pYWVsgjewyPHL1ajS5LTcQ@mail.gmail.com>
Panagiotis Astithas <pastith@gmail.com> writes:
Show 17 quoted lines
> On Fri, Jun 12, 2015 at 6:46 AM, Eric Sunshine <sunshine@sunshineco.com> wrote: >> On Thu, Jun 11, 2015 at 10:37 AM, Panagiotis Astithas <pastith@gmail.com> wrote: >>> The output of "pmset -g batt" changed at some point from >>> "Currently drawing from 'AC Power'" to the slightly different >>> "Now drawing from 'AC Power'". Starting the match from "drawing" >>> makes the check work in both old and new versions of OS X. >> >> Would it make sense to try to future-proof this further by searching >> only for "'AC" (including the leading single-quote) or just "AC" >> (without the leading quote)? >> >> (Genuine question. I don't have a strong feeling about it.) > > It's a reasonable idea, although I'm wondering what are the odds of > pmset changing to output a string when running on battery in the > future, containing something like "no longer on 'AC Power'". That's > probably too far out though.
Once they start drawing from USB-C, they may stop referring to AC altogether; unless you have a crystal ball, it is futile to spend too many brain cycles to try futureproofing.
Prediction is very difficult, especially if it's about the future.