COMMIT_RANGE has problems on forks or local branches:
- When
LOCAL_BRANCHis set, it assumes the presence of amasterbranch, and that themasterbranch is up-to-date. Both of which may be false. (See also discussion in #29274 (review)) - When
COMMIT_RANGEisn’t set inlint-git-commit-check.py, and--prev-commitsisn’t set either, it has the same (broken) assumptions.
Fix all issues by simply assuming a merge commit exists. This allows to drop LOCAL_BRANCH. It also allows to drop SKIP_EMPTY_NOT_A_PR, because scripts will already skip an empty range. Finally, it allows to drop --prev-commits n, because one can simply say COMMIT_RANGE='HEAD~n..HEAD' to achieve the same.