3 if [[ -n "${PPG_DEBUG}" ]]; then
7 GIT_DIR
=$
(git rev-parse
--git-dir)
9 if [ -z "$GIT_DIR" ]; then
10 echo >&2 "Not in a git checkout"
14 cat << 'EOF' > $GIT_DIR/hooks
/pre-commit.tmp$$
17 if [ -z "$PPG_COMMIT" ]; then
18 echo >&2 On this repository
, use ppg commit instead of git commit
24 if ! cmp $GIT_DIR/hooks
/pre-commit
$GIT_DIR/hooks
/pre-commit.tmp$$
; then
25 cp $GIT_DIR/hooks
/pre-commit
{,.backup-$
(date +%Y
%m
%d
%H
%M
)}
26 mv $GIT_DIR/hooks
/pre-commit.tmp$$
$GIT_DIR/hooks
/pre-commit
28 chmod ugo
+x
$GIT_DIR/hooks
/pre-commit