COMMIT_RANGE
has problems on forks or local branches:
- When
LOCAL_BRANCH
is set, it assumes the presence of amaster
branch, and that themaster
branch is up-to-date. Both of which may be false. (See also discussion in #29274 (review)) - When
COMMIT_RANGE
isn’t set inlint-git-commit-check.py
, and--prev-commits
isn’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.