Last active
January 3, 2016 02:49
-
-
Save mgurov/8397959 to your computer and use it in GitHub Desktop.
git status + checked out maven pom version + git diff to given branch
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 -e | |
#depends on xml starlet, brew install xmlstarlet | |
if [ $1 ]; then | |
BASE_BRANCH=$1 | |
else | |
BASE_BRANCH=origin/master | |
fi | |
bold=`tput smso` | |
offbold=`tput rmso` | |
echo $bold | |
for dir in */; do | |
echo ${bold}$dir${offbold} `xml sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "x:project/x:version" $dir/pom.xml` | |
cd $dir | |
if ! git diff-index --quiet HEAD --; then | |
git status --short | |
fi | |
if git show-ref -q $BASE_BRANCH; then | |
git log $BASE_BRANCH~1.. --oneline | |
else | |
echo "-unbranched-" | |
fi | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment