Skip to content

Instantly share code, notes, and snippets.

@skwp
Created June 5, 2009 19:40
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 skwp/124462 to your computer and use it in GitHub Desktop.
Save skwp/124462 to your computer and use it in GitHub Desktop.
# 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