threads / patch / 39640

patchFix power checking on OS X

Subject: [PATCH] Fix power checking on OS X

## tl;dr

4 messages between Jun 16, 2015 and Jun 16, 2015. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Panagiotis Astithas· Jun 16, 2015, 07:36 UTC · lore

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.

Signed-off-by: Panagiotis Astithas <pastith@gmail.com>
---
 contrib/hooks/pre-auto-gc-battery | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to contrib/hooks/pre-auto-gc-battery +1 −1
diff --git a/contrib/hooks/pre-auto-gc-battery b/contrib/hooks/pre-auto-gc-battery
index 9d0c2d1..6a2cdeb 100755
--- a/contrib/hooks/pre-auto-gc-battery
+++ b/contrib/hooks/pre-auto-gc-battery
@@ -33,7 +33,7 @@ elif grep -q "AC Power \+: 1" /proc/pmu/info 2>/dev/null
 then
 	exit 0
 elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
-	grep -q "Currently drawing from 'AC Power'"
+	grep -q "drawing from 'AC Power'"
 then
 	exit 0
 fi
-- 
2.4.1
Junio C Hamano· Jun 16, 2015, 17:32 UTC · re: Panagiotis Astithas · lore

Re: [PATCH] Fix power checking on OS X

Panagiotis Astithas <pastith@gmail.com> writes:
Show 7 quoted lines
> 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.
>
> Signed-off-by: Panagiotis Astithas <pastith@gmail.com>
> ---

Hmph, is there any difference between this one and the original one that I already queued several days ago?

Show 16 quoted lines
>  contrib/hooks/pre-auto-gc-battery | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/hooks/pre-auto-gc-battery b/contrib/hooks/pre-auto-gc-battery
> index 9d0c2d1..6a2cdeb 100755
> --- a/contrib/hooks/pre-auto-gc-battery
> +++ b/contrib/hooks/pre-auto-gc-battery
> @@ -33,7 +33,7 @@ elif grep -q "AC Power \+: 1" /proc/pmu/info 2>/dev/null
>  then
>  	exit 0
>  elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
> -	grep -q "Currently drawing from 'AC Power'"
> +	grep -q "drawing from 'AC Power'"
>  then
>  	exit 0
>  fi
Panagiotis Astithas· Jun 16, 2015, 17:35 UTC · re: Junio C Hamano · lore

Re: [PATCH] Fix power checking on OS X

On Tue, Jun 16, 2015 at 8:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Panagiotis Astithas <pastith@gmail.com> writes:
>
>> 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.
>>
>> Signed-off-by: Panagiotis Astithas <pastith@gmail.com>
>> ---
>
> Hmph, is there any difference between this one and the original one
> that I already queued several days ago?

None, I was just following the process outlined in SubmittingPatches that mentions a separate email after the discussion is over.

Junio C Hamano· Jun 16, 2015, 17:57 UTC · re: Panagiotis Astithas · lore

Re: [PATCH] Fix power checking on OS X

Ah, thanks.  Not many people do that, so I was wondering what was going on ;-).
On Tue, Jun 16, 2015 at 10:35 AM, Panagiotis Astithas <pastith@gmail.com> wrote:
Show 16 quoted lines
> On Tue, Jun 16, 2015 at 8:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Panagiotis Astithas <pastith@gmail.com> writes:
>>
>>> 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.
>>>
>>> Signed-off-by: Panagiotis Astithas <pastith@gmail.com>
>>> ---
>>
>> Hmph, is there any difference between this one and the original one
>> that I already queued several days ago?
>
> None, I was just following the process outlined in SubmittingPatches
> that mentions a separate email after the discussion is over.

← back to recent threads