Project

General

Profile

Actions

Misc #16093

closed

Prohibit a "foxtrot merge" instead of a merge commit

Added by k0kubun (Takashi Kokubun) over 5 years ago. Updated over 5 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:94225]

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

  1. Improve the rubyfarmer's implementation to make it work even if we had merge commits. https://github.com/mame/rubyfarmer/pull/1
  2. 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
  1. Fix bugs in check-email.rb to correctly check merge commits.
  2. 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.


Related issues 1 (0 open1 closed)

Related to Ruby master - Misc #16094: Allow only "Rebase and merge" or "Squash and merge" on GitHub master branch, and sync it on git.ruby-lang.org update hookClosedk0kubun (Takashi Kokubun)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0