summaryrefslogtreecommitdiffstats
path: root/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/commit-msg8
-rwxr-xr-xhooks/pre-auto-gc47
2 files changed, 22 insertions, 33 deletions
diff --git a/hooks/commit-msg b/hooks/commit-msg
index 112df63f..a6721d40 100755
--- a/hooks/commit-msg
+++ b/hooks/commit-msg
@@ -1,5 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2# From Gerrit Code Review 3.10.0 d5403dbf335ba7d48977fc95170c3f7027c34659 2# DO NOT EDIT THIS FILE
3# All updates should be sent upstream: https://gerrit.googlesource.com/gerrit/
4# This is synced from commit: 62f5bbea67f6dafa6e22a601a0c298214c510caf
5# DO NOT EDIT THIS FILE
3# 6#
4# Part of Gerrit Code Review (https://www.gerritcodereview.com/) 7# Part of Gerrit Code Review (https://www.gerritcodereview.com/)
5# 8#
@@ -31,8 +34,7 @@ if test ! -f "$1" ; then
31fi 34fi
32 35
33# Do not create a change id if requested 36# Do not create a change id if requested
34create_setting=$(git config --get gerrit.createChangeId) 37case "$(git config --get gerrit.createChangeId)" in
35case "$create_setting" in
36 false) 38 false)
37 exit 0 39 exit 0
38 ;; 40 ;;
diff --git a/hooks/pre-auto-gc b/hooks/pre-auto-gc
index ec29be43..fb7b7630 100755
--- a/hooks/pre-auto-gc
+++ b/hooks/pre-auto-gc
@@ -1,33 +1,25 @@
1#!/bin/sh 1#!/bin/sh
2# DO NOT EDIT THIS FILE
3# All updates should be sent upstream: https://github.com/git/git
4# This is synced from commit: 00e10ef10e161a913893b8cb33aa080d4ca5baa6
5# DO NOT EDIT THIS FILE
2# 6#
3# An example hook script to verify if you are on battery, in case you 7# An example hook script to verify if you are on battery, in case you
4# are running Windows, Linux or OS X. Called by git-gc --auto with no 8# are running Linux or OS X. Called by git-gc --auto with no arguments.
5# arguments. The hook should exit with non-zero status after issuing an 9# The hook should exit with non-zero status after issuing an appropriate
6# appropriate message if it wants to stop the auto repacking. 10# message if it wants to stop the auto repacking.
7
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12# 11#
13# This program is distributed in the hope that it will be useful, 12# This hook is stored in the contrib/hooks directory. Your distribution
14# but WITHOUT ANY WARRANTY; without even the implied warranty of 13# may have put this somewhere else. If you want to use this hook, you
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14# should make this script executable then link to it in the repository
16# GNU General Public License for more details. 15# you would like to use it in.
17# 16#
18# You should have received a copy of the GNU General Public License 17# For example, if the hook is stored in
19# along with this program; if not, write to the Free Software 18# /usr/share/git-core/contrib/hooks/pre-auto-gc-battery:
20# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19#
21 20# cd /path/to/your/repository.git
22if uname -s | grep -q "_NT-" 21# ln -sf /usr/share/git-core/contrib/hooks/pre-auto-gc-battery \
23then 22# hooks/pre-auto-gc
24 if test -x $SYSTEMROOT/System32/Wbem/wmic
25 then
26 STATUS=$(wmic path win32_battery get batterystatus /format:list | tr -d '\r\n')
27 [ "$STATUS" = "BatteryStatus=2" ] && exit 0 || exit 1
28 fi
29 exit 0
30fi
31 23
32if test -x /sbin/on_ac_power && (/sbin/on_ac_power;test $? -ne 1) 24if test -x /sbin/on_ac_power && (/sbin/on_ac_power;test $? -ne 1)
33then 25then
@@ -48,11 +40,6 @@ elif test -x /usr/bin/pmset && /usr/bin/pmset -g batt |
48 grep -q "drawing from 'AC Power'" 40 grep -q "drawing from 'AC Power'"
49then 41then
50 exit 0 42 exit 0
51elif test -d /sys/bus/acpi/drivers/battery && test 0 = \
52 "$(find /sys/bus/acpi/drivers/battery/ -type l | wc -l)";
53then
54 # No battery exists.
55 exit 0
56fi 43fi
57 44
58echo "Auto packing deferred; not on AC" 45echo "Auto packing deferred; not on AC"