I want to inform / warn developers on a project if they are working on a git branch that has diverged a lot from the current master branch.
What's the simplest way to calculate how different the tip of a branch is from the tip of the master branch?
I was considering checking the number of commits on both branches since they last diverged, and informing the developer if that number is greater than some threshold such as 10 commits. Would this command work for this purpose, if run as a commit hook?
git log --oneline master...test/countcommitdifference | wc -l
> 3
(My team uses git, SourceTree, and BitBucket.)