Code Monkey home page Code Monkey logo

Comments (4)

MCGallaspy avatar MCGallaspy commented on July 21, 2024

Here's my .git\hooks\pre-commit, for reference. It won't work on your system probably:

#!/bin/sh

# An example hook script to verify what is about to be pushed.  Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed.  If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
#   <local ref> <local sha1> <remote ref> <remote sha1>
#
# This sample shows how to prevent push of commits where the log message starts
# with "WIP" (work in progress).

pushd /d/kolibri/
/c/users/mike/envs/kolibri/scripts/activate

/c/users/mike/envs/kolibri/scripts/tox.exe -e lint
LINT=$( echo $? )

if [ $LINT -ne 0 ]
then
    echo "Linting failed with return code:"
    exit $LINT
fi

/c/users/mike/envs/kolibri/scripts/tox.exe -e py2.7
PY27=$( echo $? )

if [ $PY27 -ne 0 ]
then
    echo "Py2.7 tests failed with return code:"
    exit $PY27
fi

exit 0

from kolibri.

MCGallaspy avatar MCGallaspy commented on July 21, 2024

Or are you suggesting a server-side hook?

from kolibri.

benjaoming avatar benjaoming commented on July 21, 2024

See http://pre-commit.com/

from kolibri.

rtibbles avatar rtibbles commented on July 21, 2024

I couldn't sleep, @benjaoming. Yoink!

from kolibri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.