-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent incorrect merges between branches #15028
Comments
@marcusdacoregio I like the pre-commit hook idea as a possible solution. The issue with workflows is that it would be too late to prevent it, right? The gradle task is nice too but it's technically optional to run it locally and can be skipped. |
I believe what happened was that I accidentally merged Using Another idea would be to introduce a git hook that considers whether a merge is valid. For example, it is always invalid to attempt to merge Hypothetically, we could go further and introduce a script that would check for merging any branch "to the right", |
Recently, a wrong merge happened from
main
into6.2.x
, since the merge was a fast-forward it went unnoticed until a contributor reported it in #15016. The result was that6.2.x
was synced withmain
.We should prevent it from happening again, a few suggestions are:
*.x
and then compare it with theversion
ingradle.properties
. Thecheck
task would depend on this new task.--no-ff
), this will create a merge commit even when a fast-forward is possible, making it easier to spot the mistakeThe text was updated successfully, but these errors were encountered: