Skip to content

Instantly share code, notes, and snippets.

Created December 9, 2015 11:56
Show Gist options
  • Save anonymous/dc08e406746a02a5e4eb to your computer and use it in GitHub Desktop.
Save anonymous/dc08e406746a02a5e4eb to your computer and use it in GitHub Desktop.
output=""
function le_print {
echo "$1" >> $output
}
function check_commit {
commit_subject=$1
commit_id=`git log --oneline | grep "$commit_subject" | grep -v "Merge \"" | awk '{print $1}'`
branch=`git branch| grep \*`
le_print " ... checking $branch for $commit_subject"
if [ -z $commit_id ]; then
le_print " ... NOPE NOT ON $branch";
else
le_print " ... YUP ON $branch with commit:'$commit_id'";
change_id=`git log $commit_id -n 1 | grep "Change-Id" | awk '{print $2}'`
upstream_url="http://review.openstack.org/#q,$commit_id,n,z"
le_print " ... try firefox $upstream_url"
fi
}
echo "gimme the upstream tripleo heat templates directory"
read upstream_directory
cd $upstream_directory
echo "gimme commit subjects file"
read input
echo "gimme output file"
read output
i=0
while IFS= read -r subject
do
le_print "***$i***"
le_print "$subject"
git checkout master
check_commit "$subject"
git checkout stable/liberty
check_commit "$subject"
let "i+=1"
done < "$input"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment