Last active
July 11, 2017 21:07
-
-
Save neilk/acbcbf83670a29f2937dc487e6677609 to your computer and use it in GitHub Desktop.
Revisions
-
neilk revised this gist
Jul 11, 2017 . 1 changed file with 16 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,31 @@ #!/bin/bash # Find dependency changes in a branch in a scala project using sbt. # You have to have the https://github.com/jrudolph/sbt-dependency-graph plugin installed. # the standard `sed` on Mac OS X won't work, so make sure to install GNU sed via brew. branch="$1" function is_git_clean() { [[ $(git status 2> /dev/null | tail -n1) =~ "nothing to commit" ]] } if ! is_git_clean; then echo "your git repo has changes. Commit them first"; exit 1; fi git checkout master sbt dependencyList > /tmp/deps-master git checkout "$branch" # your branch sbt dependencyList > /tmp/deps-branch # sbt outputs ANSI colors, always. Strip them away gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" /tmp/deps-master > /tmp/deps-master-plain gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" /tmp/deps-branch > /tmp/deps-branch-plain @@ -26,5 +34,4 @@ perl -wlne '/([\w-]+(\.[\w-]+)*:)+\d+(\.\d+)+/ and print $&' /tmp/deps-master-pl perl -wlne '/([\w-]+(\.[\w-]+)*:)+\d+(\.\d+)+/ and print $&' /tmp/deps-branch-plain | sort | uniq > /tmp/deps-branch-plain-uniq # and diff them diff /tmp/deps-{master,branch}-plain-uniq -
neilk revised this gist
Jul 6, 2017 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,12 @@ # Find dependency changes in a branch in a scala project using sbt. # You have to have the https://github.com/jrudolph/sbt-dependency-graph plugin installed. # if you don't have `gsed`: # the standard `sed` on Mac OS X won't work, so make sure you have GNU sed. We assume you want to keep that separate # from your system sed, so just `brew install gnu-sed` # if you're on a unix with a proper sed: # just change the lines below to `sed` branch="$1" git checkout master -
neilk created this gist
Jul 6, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/bash # Find dependency changes in a branch in a scala project using sbt. # You have to have the https://github.com/jrudolph/sbt-dependency-graph plugin installed. branch="$1" git checkout master sbt dependencyList > /tmp/deps-master git checkout "$branch" # your branch sbt dependencyList > /tmp/deps-branch # sbt outputs ANSI colors, always. Strip them away gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" /tmp/deps-master > /tmp/deps-master-plain gsed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" /tmp/deps-branch > /tmp/deps-branch-plain # get just the package names perl -wlne '/([\w-]+(\.[\w-]+)*:)+\d+(\.\d+)+/ and print $&' /tmp/deps-master-plain | sort | uniq > /tmp/deps-master-plain-uniq perl -wlne '/([\w-]+(\.[\w-]+)*:)+\d+(\.\d+)+/ and print $&' /tmp/deps-branch-plain | sort | uniq > /tmp/deps-branch-plain-uniq # and diff them diff /tmp/deps-{master,branch}-plain-uniq