Created
May 1, 2013 11:36
-
-
Save hemanth/5494852 to your computer and use it in GitHub Desktop.
git_notify
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
function cd() { | |
async() { | |
{ | |
$2 $($1) | |
}& | |
} | |
notify_callback() { | |
[[ $1 > 0 ]] && echo "You have new stuff to pull!" | |
} | |
# If it's a git repo, check if we need to pull. | |
if git rev-parse --is-inside-work-tree &>/dev/null; then | |
async "git rev-list HEAD...origin/master --count" notify_callback | |
fi | |
builtin cd "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment