Issue #16094 has been updated by k0kubun (Takashi Kokubun).

Status changed from Assigned to Closed

While this feature is experimental, I wrote a script to automatically check the consistency between Git repositories every 10 minutes. So it's somewhat safe now, and we'd be able to always restore the repository from logs. I'll take the responsibility to do the recovery if something happens...

That being said, I enabled "write" access to "ruby-committers" team to use the GitHub merge button with either "Squash and merge" and "Rebase and merge". As discussed in [Misc #16093], a "Create a merge commit" is disabled. It's available only for master branch, and other branches are protected by CI.

Here's the summary:

## What's changed?
* You can push "Squash and merge" or "Rebase and merge" on a GitHub pull request, but only for master branch.

## What's not changed?
* Committers should continue to use git.ruby-lang.org for usual `git pull` / `git push` destination.
* Nothing is changed in branches other than "master".
  * "master" is the only branch which is synchronized bidirectionally.
  * "trunk" and "master" are mirrored each other, but pull requests can be merged only to "master". Of course, you can still push commits to "trunk" branch from git.ruby-lang.org as before.
* `git push` to git.ruby-lang.org became slightly slower, almost as slow as `git push` to GitHub. I'm really sorry about this.
* You cannot directly push to GitHub ruby/ruby master branch, except "admin" users.
  * We need to allow this to admin users because matzbot (admin) needs to sync commits to GitHub.
  * While `git push` to GitHub ruby/ruby master branch would work by bidirectional sync, to simplify the problem, admin should not push commits directly to GitHub.
  * "admin" users: ruby/ruby owners (@matsuda, @hsbt, @mame, @naruse), @k0kubun, and matzbot.
* You cannot use a merge button against non-master branches, except "admin" users.
  * Pushing whatever commits to non-master branch would introduce inconsistency, just as before (this fact is NOT changed in this ticket). Be careful, "admin" users.

----------------------------------------
Misc #16094: Allow only "Rebase and merge" or "Squash and merge" on GitHub, and sync it on git.ruby-lang.org pre-receive hook
https://bugs.ruby-lang.org/issues/16094#change-80710

* Author: k0kubun (Takashi Kokubun)
* Status: Closed
* Priority: Normal
* Assignee: k0kubun (Takashi Kokubun)
----------------------------------------
## Problem
* Our pull request merge strategy confuses contributors, as described in [Misc #16093].
* In [Misc #16093], some committers did not like accepting a merge commit.

## Solution
* Allow using GitHub's "Rebase and merge" (suggested by @marcandre) and "Squash and merge" (for editing a commit message as needed) to committers
  * Disable "Create a merge commit" in GitHub repository settings, to avoid concerns found in [Misc #16093].
  * Also prohibit pushes to the master branch which are not coming from a pull request by requiring CI in GitHub repository settings.
  * To allow looking up an associated GitHub pull request from git commands, add `git notes` to "Rebase and merge"d commits in git.ruby-lang.org post-receive hook. (suggested by @nobu)
* Perform GitHub bidirectional sync on git.ruby-lang.org pre-receive hook, and accept a push if it does not conflict with "Rebase and merge" on GitHub.

## Notes
* Even after implementing this ticket, the Ruby's canonical Git repository will continue to be git.ruby-lang.org as is.
* All committers must push non-pull-request commits to git.ruby-lang.org. Direct pushes to GitHub will continue to be disabled.
* This approach has one drawback; `git push` to git.ruby-lang.org might block longer than now.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>