Skip to content

Commit

Permalink
.pre-commit-config.yaml: disallow commiting to version branches
Browse files Browse the repository at this point in the history
before this commit, it was possible to accidentally commit to
the stable version branches (such as 2.3). If this was done
by a member with push access, they could push untested commits
into production on accident. If this was done by a git newbie,
they would mess up their local branch and deal with conflicts
when pulling their branch later. If commiting to the branch
is justified, the check can be bypassed by
`SKIP=no-commit-to-branch git commit`
  • Loading branch information
Swiftb0y committed Oct 30, 2021
1 parent 4ec46c6 commit bb54189
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ repos:
- commit
- manual
- id: no-commit-to-branch
# protect main and any branch that has a semver-like name
args: [-b, main, -p, '^\d+.\d+(?:.\d)*$']
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
Expand Down

0 comments on commit bb54189

Please sign in to comment.