Actions
Misc #16093
closedProhibit a "foxtrot merge" instead of a merge commit
Status:
Rejected
Assignee:
-
Description
Background¶
- When we migrated the canonical Ruby repository from Subversion to Git [Misc #14632], in that ticket nobody had objected to allowing a merge commit in the repository.
- At first, we decided to prohibit merge commits because:
- The first merge commit https://github.com/ruby/ruby/pull/2084 went well. Then we tried the second merge commit for https://github.com/ruby/ruby/pull/2079 but it failed.
- We struggled to find why only the first one succeeded. That was tricky because ruby-commit-hook's pre-receive hook was updated to a new revision after the first merge happened, and the new revision included a change that accidentally made a merge commit impossible.
- Because the merge commit made it harder to debug the issue in ruby-commit-hook, we decided to deliberately prohibit to push a merge commit to the master branch for a while to reduce the number of problems to be solved during the early stage of the migration to git. These days the ruby-commit-hook has worked stably.
- Then we also noticed that prohibiting merge commits makes it easier to efficiently list up revisions to be built by the bisect bot rubyfarmer without having a data store.
- If we do not make a merge commit, there's only one way to make a pull request "Merged" on GitHub ruby/ruby:
- Push commits in the pull requests to the master branch when their parent revision is the same as the master branch's one.
- Therefore, we have not been able to make a pull request "Merged" when a pull request's branch needs to be rebased before pushing it to the master branch.
- But force-pushing the rebased commits to their author's branch is a bad habit and we do not want to do so.
Problem¶
- Some contributors get confused when their pull request is committed to the master branch but it's marked as "Closed" on GitHub [Misc #16089].
- Even though we clarified the situation in https://bugs.ruby-lang.org/projects/ruby/wiki/HowToContribute, a first-time contributor could be confused and the person might complain about it to the committer.
Solution¶
- Improve the rubyfarmer's implementation to make it work even if we had merge commits. https://github.com/mame/rubyfarmer/pull/1
- To maintain a consistent linear history in the git log even after allowing merge commits, implement a guard to prevent a "foxtrot merge" in the pre-receive hook. https://github.com/ruby/ruby-commit-hook/pull/19
- Details: https://devblog.nestoria.com/post/98892582763/maintaining-a-consistent-linear-history-for-git
- Fix bugs in check-email.rb to correctly check merge commits.
- Allow pushing merge commits to the master branch.
We'll implement 2, 3, and 4 shortly. Please let me know if you have any opinion about this.
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0