Created
May 23, 2013 20:42
-
-
Save rpetrich/5639285 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
# git-ticket-show by Ryan Petrich | |
if [ -e $1 ] ; then | |
echo "usage: git ticket-show <ticket>" | |
else | |
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
REVLIST=`git rev-list HEAD` | |
echo "Merge status of ticket $1 relative to $BRANCH:" | |
git log --all --no-merges --format=%H --grep="$1[:+]" | \ | |
while read commit | |
do | |
if (grep -c $commit > /dev/null <<< "$REVLIST") ; then | |
MERGETEXT="%C(green)✓" | |
else | |
MERGETEXT="%C(red)×" | |
fi | |
git --no-pager show --color $commit --format="%n$MERGETEXT %H%Creset %ar by %C(yellow)%cN <%aE>%Creset%n %C(white)%s%Creset" | git name-rev --stdin | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment