- Show number of commits that exist in develop, but NOT in the current branch (is my branch sync’d with develop? Should return 0)
git rev-list HEAD..origin/develop --no-merges | wc –l
- Show number of commits that exist in develop, but NOT in master or vice-versa (have master and develop diverged?)
- (have master and develop diverged in some way? Irrespective of current branch – should return 0)
git rev-list origin/develop...origin/master --no-merges | wc -l
- (does develop have anything not in master? Irrespective of current branch – should return 0)
git rev-list origin/develop..origin/master --no-merges | wc –l
- (does master have anything not in develop? Irrespective of current branch)
- (just a total number of commits – should return 0)
git rev-list origin/master..origin/develop--no-merges | wc –l
- (show authors involved in the mutiny – should return nothing)
git log --pretty=format:%an origin/develop...origin/master --no-merges | sort | uniq -c | sed -e 's/^\s\+\([0-9]\+\)/\1\t/g' | awk -F "\t" '{print $2"\t:\t"$1" commits"}' | column -s $'\t' –t
- (just a total number of commits – should return 0)
- (do master or develop have anything NOT from the latest release branch? (assumes your release branches are named such that
sort
properly sorts them with most recent branch last (semantic or date versioning should work). Should return 0)- (just a total number of commits – should return 0)
lastRelease=$(git branch -r --merged origin/master | grep "/release/" | sort | tail -1 | sed -e "s/\s//g"); git log origin/master origin/develop ^$lastRelease | wc -l | awk '{print $0" commits found"}'
- (show authors involved in the mutiny – should return nothing)
lastRelease=$(git branch -r --merged origin/master | grep "/release/" | sort | tail -1 | sed -e "s/\s//g"); git log --pretty=format:%an origin/master origin/develop ^$lastRelease | sort | uniq
- (just a total number of commits – should return 0)
- (have master and develop diverged in some way? Irrespective of current branch – should return 0)
Last active
August 29, 2015 13:56
-
-
Save bobjackman/8925801 to your computer and use it in GitHub Desktop.
Git one-liners to detect improper use of git-flow during release.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment