Skip to content

Instantly share code, notes, and snippets.

@dylnuge
Created July 10, 2012 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylnuge/3086865 to your computer and use it in GitHub Desktop.
Save dylnuge/3086865 to your computer and use it in GitHub Desktop.
Ice Ice Baby Script for Cole
#! /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
@dylnuge
Copy link
Author

dylnuge commented Jul 10, 2012

@dylnuge
Copy link
Author

dylnuge commented Jul 10, 2012

I have not tested this and my bash-foo is rusty, so this may not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment