summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 79fd4cc)
raw | patch | inline | side by side (parent: 79fd4cc)
author | Jonathan del Strother <jon.delStrother@bestbefore.tv> | |
Mon, 29 Sep 2008 23:36:28 +0000 (00:36 +0100) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 30 Sep 2008 19:27:20 +0000 (12:27 -0700) |
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
contrib/hooks/pre-auto-gc-battery | patch | blob | history |
index 0096f57b7e09f33108d7177405d02eec05811c03..b0a8caae9e7822fd4ea5c6e9b202373b2947e6af 100644 (file)
#!/bin/sh
#
# An example hook script to verify if you are on battery, in case you
-# are running Linux. Called by git-gc --auto with no arguments. The hook
-# should exit with non-zero status after issuing an appropriate message
-# if it wants to stop the auto repacking.
+# are running Linux or OS X. Called by git-gc --auto with no arguments.
+# The hook should exit with non-zero status after issuing an appropriate
+# message if it wants to stop the auto repacking.
#
# This hook is stored in the contrib/hooks directory. Your distribution
# may have put this somewhere else. If you want to use this hook, you
then
exit 0
elif grep -q '0x01$' /proc/apm 2>/dev/null
+then
+ exit 0
+elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
+ grep -q "Currently drawing from 'AC Power'"
then
exit 0
fi