Created
June 5, 2009 19:40
-
-
Save skwp/124462 to your computer and use it in GitHub Desktop.
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
# Prerequisites | |
# 1. Your commit messages contain ticket numbers such as "Ticket #1234" | |
# 2. Your collaborators create branches named exactly for the ticket number. So for example, bob/1234 | |
# | |
# Usage: merged_branches [remote_name] | |
# Output: A list of branches (tickets) that have already been merged (can be found in your log) | |
# | |
function merged_branches { | |
for branch in `git branch -a | grep $1 | awk '{ print $1 }' | awk -F"/" '{print $2}'` | |
do | |
git short --grep="#$branch" | awk -F"#" {'print $2'} | awk {'print $1'} | |
done | sort | uniq | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment