Skip to content
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 merging empty commits #809

Open
xmo-odoo opened this issue Sep 7, 2023 · 0 comments
Open

Prevent merging empty commits #809

xmo-odoo opened this issue Sep 7, 2023 · 0 comments
Labels
Projects

Comments

@xmo-odoo
Copy link
Collaborator

xmo-odoo commented Sep 7, 2023

Because low level APIs are used during staging, if two PRs doing the same thing are merged one of them will just generate an empty commit. Which is not detrimental, but is not super useful either (it's noise in the history).

Might be a good idea to trigger a merge error if, during rebase, applying a commit does not change the tree.

Would probably need to fetch the tree of the commit being staged on, to ensure the first commit is also handled correctly.\

Beware the freeze wizard though, it needs to be able to merge empty commits.

@xmo-odoo xmo-odoo added this to ideas in Mergebot via automation Oct 4, 2023
@xmo-odoo xmo-odoo moved this from ideas to accepted in Mergebot Oct 4, 2023
@xmo-odoo xmo-odoo moved this from accepted to working in Mergebot Oct 6, 2023
@xmo-odoo xmo-odoo moved this from working to done in Mergebot Oct 9, 2023
xmo-odoo added a commit that referenced this issue Jan 16, 2024
The low-level APIs used by the staging process don't do any merge
check, so because of the way Git works it's possible for them to merge
commits with content as empty commits, e.g. if something was merged
then backported and the backport was merged on top. This should
trigger a merge failure as we don't really want to merge newly
empty. This is a feature which some high level commands of git
support, kind-of, e.g. by default `git rebase --interactive` will ask
about newly empty commits.

Take care to allow merging already-empty commits, as these do have a
use for signaling, freezes, ....

Fixes #809
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant