Skip to content

Instantly share code, notes, and snippets.

@jglick
Last active July 25, 2019 19:20
Show Gist options
  • Save jglick/b0ff2942a78573bd64379500c015288c to your computer and use it in GitHub Desktop.
Save jglick/b0ff2942a78573bd64379500c015288c to your computer and use it in GitHub Desktop.
run with optional args, e.g., {workflow,pipeline}-*-plugin
#!/bin/bash
# http://stackoverflow.com/a/37730085/12916
if [ $# -ge 1 ]
then
files="$@"
else
files=*
fi
for r in $files
do
echo considering $r
if [ -f $r/pom.xml ] && egrep -q '<tag>(HEAD|master|[$][{]scmTag[}])</tag>' $r/pom.xml
then
cd $r
echo "====== $r ====="
git pull --ff-only
git log --merges $(git log --reverse --ancestry-path --pretty=%H $(git describe --abbrev=0 HEAD)..HEAD | head -1)...HEAD
cd ..
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment