From 2df3aa4a5313a433cf515563c8967ca8bd01febb Mon Sep 17 00:00:00 2001 From: Tyler Berry Date: Wed, 13 Jun 2018 18:00:14 -0700 Subject: [PATCH] Remove pre-commit hooks --- bin/pre-commit | 40 ---------------------------------------- broker/bin/pre-commit | 34 ---------------------------------- 2 files changed, 74 deletions(-) delete mode 100755 bin/pre-commit delete mode 100755 broker/bin/pre-commit diff --git a/bin/pre-commit b/bin/pre-commit deleted file mode 100755 index cbf5ca931343..000000000000 --- a/bin/pre-commit +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - - -#!/bin/bash -# Run local pre-commit hook -# -# If called directly, installs a pre-commit hook - -set -o errexit - -WD=$(dirname $0) -WD=$(cd $WD; pwd) -ROOT=$(dirname $WD) -if [[ $ROOT == */.git ]]; then - ROOT=$ROOT/.. -fi - -export GOPATH=$(cd $ROOT/../..) -export PATH=$GOPATH/bin:$PATH - -# Not running under git commit -# install handler -if [[ -z ${GIT_AUTHOR_DATE} ]];then - cd $ROOT/.git/hooks/ - if !([[ -e pre-commit ]] || [[ -h pre-commit ]]); then - echo "Installing pre-commit hook" - ln -s $ROOT/bin/pre-commit - else - echo "Hook already installed" - fi - exit 0 -fi - -# If we don't have a branch then we're in a detached state (e.g. mid -# rebase) and don't want to execute our checks. -BRANCH_NAME=$(git branch | grep '*' | sed 's/* //') -if [ $BRANCH_NAME != '(no branch)' ]; then - cd $ROOT - make precommit -fi diff --git a/broker/bin/pre-commit b/broker/bin/pre-commit deleted file mode 100755 index 1f7dd8c3fcde..000000000000 --- a/broker/bin/pre-commit +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Run local pre-commit hook -# -# If called directly install pre-commit hook - - -WD=$(dirname $0) -WD=$(cd $WD; pwd) -ROOT=$(dirname $WD) - -# Not running under git commit -# install handler -if [[ -z ${GIT_AUTHOR_DATE} ]];then - cd $ROOT/.git/hooks/ - if [[ ! -e pre-commit ]]; then - echo "Installing pre-commit hook" - ln -s ../../bin/pre-commit - fi - exit 0 -fi - -# if found WORKSPACE file, we are good -if [[ -f WORKSPACE ]]; then - ROOT=$PWD -fi - -# If we don't have a branch then we're in a detached state (e.g. mid rebase) and don't want to execute our checks. -BRANCH_NAME=$(git branch | grep '*' | sed 's/* //') -if [ $BRANCH_NAME != '(no branch)' ]; then - cd $ROOT - - echo "formatting..." - make fmt -fi