# [PATCH] Fix power checking on OS X

4 messages from 2015-06-16 to 2015-06-16. Participants: Panagiotis Astithas, Junio C Hamano.
Thread: https://gitlist.dev/t/39640

## Panagiotis Astithas, 2015-06-16 07:36

Subject: [PATCH] Fix power checking on OS X
Message-ID: <1434440167-1046-1-git-send-email-pastith@gmail.com>
URL: https://gitlist.dev/e/1434440167-1046-1-git-send-email-pastith%40gmail.com

```
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(-)

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, 2015-06-16 17:32

Subject: Re: [PATCH] Fix power checking on OS X
Message-ID: <xmqqr3pb5zl1.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqr3pb5zl1.fsf%40gitster.dls.corp.google.com
In-Reply-To: <1434440167-1046-1-git-send-email-pastith@gmail.com>

```
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?

>  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, 2015-06-16 17:35

Subject: Re: [PATCH] Fix power checking on OS X
Message-ID: <CACvVhd6j_zWpvfXti1=U8iOaXE+oTUtmjrHu39VR12UNBxkY4A@mail.gmail.com>
URL: https://gitlist.dev/e/CACvVhd6j_zWpvfXti1%3DU8iOaXE%2BoTUtmjrHu39VR12UNBxkY4A%40mail.gmail.com
In-Reply-To: <xmqqr3pb5zl1.fsf@gitster.dls.corp.google.com>

```
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.

```

## Junio C Hamano, 2015-06-16 17:57

Subject: Re: [PATCH] Fix power checking on OS X
Message-ID: <CAPc5daXuJWyi2Zc-Su9w1Rn38wjTkZNo4zML8m3Hq_EwoBjnfg@mail.gmail.com>
URL: https://gitlist.dev/e/CAPc5daXuJWyi2Zc-Su9w1Rn38wjTkZNo4zML8m3Hq_EwoBjnfg%40mail.gmail.com
In-Reply-To: <CACvVhd6j_zWpvfXti1=U8iOaXE+oTUtmjrHu39VR12UNBxkY4A@mail.gmail.com>

```
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:
> 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.

```
