feat: option to skip merge commits format check #103
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
We faced faced that using this pre-commit hook brokes developer's user experience while merging branches manually.
So, there are a couple of use-cases:
Use cases
UC 1: Merging a
x.x
(release) branch todev
branch usinggit
cli:Expected:
Branch is merged, git is clean
Actual:
Pre-commit validation error in console, git merge still in progress
UC 2: Merging a
x.x
(release) branch todev
branch using IDE (any JetBrains IDE)Initiate a merge using IDE
Expected:
Branch is merged, git is clean
Actual:
Pre-commit validation error in a small popup, git merge still in progress, developer doesn't even understand what happened
What this PR does?
It adds a new option
--skip-merge-commits
which allows to skip merge commits under format validation.Merge commit has commit message prefixed with
Merge branch
(just made a research in https://github.com/git/git repo).References
#39
#84