Last active
December 9, 2015 13:57
-
-
Save danlherman/8a32fa05c2cf6018ed10 to your computer and use it in GitHub Desktop.
script to create a url for showing the changes between the last two git tags for bitbucket
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
#!/bin/bash | |
# | |
# This utility creates a bitbucket URL for showing the changes between the last two tags for the | |
# git repo you are currently in. | |
# | |
# To install this place this file in your /usr/local/bin folder and | |
# chmod +x the file so it has execution rights. Then run 'bb-change-url' from any git repo. | |
# | |
# Dan Herman | |
# | |
# | |
repo_name=`git remote show origin | grep "Fetch URL:" | sed "s#^.*/\(.*\).git#\1#"` | |
current_tag=`git tag | tail -n1` | |
previous_tag=`git tag | tail -n2 | head -n1` | |
start_url="https://bitbucket.org/gdrepo/$repo_name/branches/compare/$current_tag..$previous_tag#diff" | |
echo $start_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment