Created
October 7, 2011 21:33
-
-
Save stouset/1271397 to your computer and use it in GitHub Desktop.
Warn about unmerged branches
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
git branch -r | while read BRANCH; do | |
if [ `git incoming $BRANCH | wc -l` != 0 ]; then | |
AUTHOR=`git log $BRANCH -n 1 --format=format:%ae` | |
MESSAGE="You appear to be the person responsible for \`$BRANCH\`. It has unmerged commits. Can you take a second take make sure you still need it? If so, merge it when you can. If not, do a \`git push origin :${BRANCH#origin/}\`. Thanks." | |
echo -e $MESSAGE | mail -s "Possible stale branch" $AUTHOR | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment