All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix power checking on OS X
@ 2015-06-16  7:36 Panagiotis Astithas
  2015-06-16 17:32 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Panagiotis Astithas @ 2015-06-16  7:36 UTC (permalink / raw)
  To: gitster; +Cc: git, Panagiotis Astithas

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-16  7:36 [PATCH] Fix power checking on OS X Panagiotis Astithas
@ 2015-06-16 17:32 ` Junio C Hamano
  2015-06-16 17:35   ` Panagiotis Astithas
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2015-06-16 17:32 UTC (permalink / raw)
  To: Panagiotis Astithas; +Cc: git

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-16 17:32 ` Junio C Hamano
@ 2015-06-16 17:35   ` Panagiotis Astithas
  2015-06-16 17:57     ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Panagiotis Astithas @ 2015-06-16 17:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-16 17:35   ` Panagiotis Astithas
@ 2015-06-16 17:57     ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2015-06-16 17:57 UTC (permalink / raw)
  To: Panagiotis Astithas; +Cc: Git List

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-12  8:53   ` Panagiotis Astithas
  2015-06-12 14:54     ` Junio C Hamano
@ 2015-06-12 15:58     ` Eric Sunshine
  1 sibling, 0 replies; 9+ messages in thread
From: Eric Sunshine @ 2015-06-12 15:58 UTC (permalink / raw)
  To: Panagiotis Astithas; +Cc: Git List

On Fri, Jun 12, 2015 at 4:53 AM, Panagiotis Astithas <pastith@gmail.com> wrote:
> 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.

That was my concern, as well, hence not feeling strongly about it.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-12  8:53   ` Panagiotis Astithas
@ 2015-06-12 14:54     ` Junio C Hamano
  2015-06-12 15:58     ` Eric Sunshine
  1 sibling, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2015-06-12 14:54 UTC (permalink / raw)
  To: Panagiotis Astithas; +Cc: Eric Sunshine, Git List

Panagiotis Astithas <pastith@gmail.com> writes:

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-12  3:46 ` Eric Sunshine
@ 2015-06-12  8:53   ` Panagiotis Astithas
  2015-06-12 14:54     ` Junio C Hamano
  2015-06-12 15:58     ` Eric Sunshine
  0 siblings, 2 replies; 9+ messages in thread
From: Panagiotis Astithas @ 2015-06-12  8:53 UTC (permalink / raw)
  Cc: Git List

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Fix power checking on OS X
  2015-06-11 14:37 Panagiotis Astithas
@ 2015-06-12  3:46 ` Eric Sunshine
  2015-06-12  8:53   ` Panagiotis Astithas
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Sunshine @ 2015-06-12  3:46 UTC (permalink / raw)
  To: Panagiotis Astithas; +Cc: Git List, vmiklos, jon.delStrother, Jonathan Nieder

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

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] Fix power checking on OS X
@ 2015-06-11 14:37 Panagiotis Astithas
  2015-06-12  3:46 ` Eric Sunshine
  0 siblings, 1 reply; 9+ messages in thread
From: Panagiotis Astithas @ 2015-06-11 14:37 UTC (permalink / raw)
  To: git; +Cc: vmiklos, jon.delStrother, jrnieder, Panagiotis Astithas

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-06-16 17:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-16  7:36 [PATCH] Fix power checking on OS X Panagiotis Astithas
2015-06-16 17:32 ` Junio C Hamano
2015-06-16 17:35   ` Panagiotis Astithas
2015-06-16 17:57     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2015-06-11 14:37 Panagiotis Astithas
2015-06-12  3:46 ` Eric Sunshine
2015-06-12  8:53   ` Panagiotis Astithas
2015-06-12 14:54     ` Junio C Hamano
2015-06-12 15:58     ` Eric Sunshine

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.