Created
May 19, 2010 06:32
-
-
Save mrdon/406037 to your computer and use it in GitHub Desktop.
Prints a changelog in wiki format from git assuming an svn backend
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/bash | |
if [ "$1" == "--help" -o $# -lt 3 ]; then | |
echo "Usage: cl.sh STUDIO_PROJECT_KEY TAG_OLD TAG_NEW" | |
echo "" | |
echo "This command is meant to be ran in a git repository pointing at a remote svn repo" | |
exit 1 | |
fi | |
oldtag=$2 | |
newtag=$3 | |
studioProjectKey=$1 | |
git log --date=short --format=tformat:"subject:%s%nbody:%b" tags/$oldtag..tags/$newtag | \ | |
sed -n " | |
/^subject:/ { | |
/^subject:\[maven\-/ !{ | |
s/subject:// | |
s/\([^\n]\{1,180\}\).*/* \1/ | |
s|\($studioProjectKey\-[0-9]\+\)|[\1\|http://studio.atlassian.com/browse/\1]| | |
p | |
} | |
} | |
/git-svn-id:/ { | |
s|.*@\([0-9]\+\) .*| [more\|http://studio.atlassian.com/source/changelog/$studioProjectKey?cs=\1]| | |
p | |
} " | \ | |
sed -n ' | |
/^ \[more/!{ | |
h | |
n | |
H | |
x | |
s/\n// | |
p | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment