summaryrefslogtreecommitdiff
path: root/contrib/hooks/pre-auto-gc-battery
AgeCommit message (Collapse)AuthorFilesLines
2018-02-28hooks/pre-auto-gc-battery: allow gc to run on non-laptopsLibravatar Adam Borowski1-1/+1
Desktops and servers tend to have no power sensor, thus on_ac_power returns 255 ("unknown"). Thus, let's take any answer other than 1 ("battery") as no contraindication to run gc. If that tool returns "unknown", there's no point in querying other sources as it already queried them, and is smarter than us (can handle multiple adapters). Reported by: Xin Li <delphij@google.com> Signed-off-by: Adam Borowski <kilobyte@angband.pl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-12hooks/pre-auto-gc: adjust power checking for newer OS XLibravatar Panagiotis Astithas1-1/+1
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-11-25mark contributed hooks executableLibravatar Jonathan Nieder1-1/+0
The docs in contrib/hooks/pre-auto-gc-battery suggest: For example, if the hook is stored in /usr/share/git-core/contrib/hooks/pre-auto-gc-battery: chmod a+x pre-auto-gc-battery cd /path/to/your/repository.git ln -sf /usr/share/git-core/contrib/hooks/pre-auto-gc-battery \ hooks/pre-auto-gc Unfortunately on multi-user systems most users do not have write access to /usr. Better to mark the sample hooks executable in the first place so users do not have to tweak their permissions to use them by symlinking into .git/hooks/. Reported-by: Olivier Berger <olivier.berger@it-sudparis.eu> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-14Add Linux PPC support to the pre-auto-gc example hookLibravatar Miklos Vajna1-0/+3
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-30Add OS X support to the pre-auto-gc example hookLibravatar Jonathan del Strother1-3/+7
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>
2008-04-09contrib/hooks: add an example pre-auto-gc hookLibravatar Miklos Vajna1-0/+36
It disables git-gc --auto when you are running Linux and you are not on AC. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>