Created
July 10, 2012 23:20
-
-
Save dylnuge/3086865 to your computer and use it in GitHub Desktop.
Ice Ice Baby Script for Cole
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Simple Ice Ice Baby control script for Git. | |
# If problems occur during build, fix by checking out the hook while the DJ | |
# resolves it. | |
# Script assumes user is the DJ and that there is a pre-commit hook in the | |
# previous commit (current base) located at hooks/pre-commit. Script assumes | |
# it is being run in the main project directory (top level git dir). Script | |
# assumes "make" with no arguments will correctly build project. | |
# Author: Dylan Nugent | |
make; | |
if [ !? -ne 0]; then | |
( | |
git checkout -- hooks/pre-commit && | |
cp {,.git/}hooks/pre-commit && | |
git pull | |
); | |
if [ !? -ne 0]; then | |
git difftool -yt vimdiff | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have not tested this and my bash-foo is rusty, so this may not work.