https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112019-08-10T09:30:35ZRuby Issue Tracking SystemRuby 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=805562019-08-10T09:30:35Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Related to</strong> <i><a class="issue tracker-5 status-6 priority-4 priority-default closed" href="/issues/16093">Misc #16093</a>: Prohibit a "foxtrot merge" instead of a merge commit</i> added</li></ul> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=805872019-08-11T03:47:52Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Assignee</strong> set to <i>k0kubun (Takashi Kokubun)</i></li></ul> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=805882019-08-11T04:16:40Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>"Rebase and merge" makes the target commits unable to track the original pull request from <code>git log</code>.<br>
So I propose "squash and merge", or pushing a marking commit at the sync after "rebase and merge".</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=805892019-08-11T04:29:32Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>I'm personally okay with "squash and merge" too, especially because "rebase and merge" cannot update a commit message when we want to add a thing like <code>[Bug #12345]</code>. We can allow both "rebase and merge" and "squash and merge", and make either of them ruby/ruby's default.</p>
<p>@jeremyevans <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/182">@marcandre (Marc-Andre Lafortune)</a> Do you have any preference on it? Or do you think it's fine to make "squash and merge" default, as it keeps a true linear history too?</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=805902019-08-11T04:51:11Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Subject</strong> changed from <i>Allow only "Rebase and merge" on GitHub and sync it on git.ruby-lang.org pre-receive hook</i> to <i>Allow only "Rebase and merge" or "Squash and merge" on GitHub, and sync it on git.ruby-lang.org pre-receive hook</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/80590/diff?detail_id=54237">diff</a>)</li></ul> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=805932019-08-11T07:41:12Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/80593/diff?detail_id=54238">diff</a>)</li></ul><p>As <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/4">@nobu (Nobuyoshi Nakada)</a> wanted to know which commit is associated to which pull request using git without accessing GitHub, he experimented <code>git notes</code> a little bit, and we found that we could automatically attach notes to "Rebase and merge"d commits on our git.ruby-lang.org's post-commit hook.</p>
<p>So probably "Squash and merge" is not mandatory for his purpose, and it seems fine to make "Rebase and merge" default.</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=806522019-08-12T08:09:12Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><blockquote>
<p>we found that we could automatically attach notes to "Rebase and merge"d commits on our git.ruby-lang.org's post-commit hook.</p>
</blockquote>
<p>I implemented this in <a href="https://github.com/ruby/ruby-commit-hook/blob/d05f66c9df2eabe45f7cb1d8bd3d51c356144e23/bin/notes-github-pr.rb" class="external">https://github.com/ruby/ruby-commit-hook/blob/d05f66c9df2eabe45f7cb1d8bd3d51c356144e23/bin/notes-github-pr.rb</a>.</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=806552019-08-12T11:26:40Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>Experimentally, I'll move GitHub sync from post-receive hook to update hook, which blocks git push a little more. Still most of the behavior would be the same, but you might feel git push became slower.</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=806562019-08-12T16:53:20Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li></ul><p>This is almost implemented. It's still under testing and only available for admin now, but you may see some usages for testing. I'll add one more guard and then enable "write" to merge pull requests for ruby-committers team.</p>
<p>I also noticed that I cannot choose either "Rebase and merge" or "Squash and merge" as the default merge behavior. When enabling both, "Squash and merge" is made always default. So it's shown by default. Of course, "Create a merge commit" mode is disabled as we discussed [Misc <a class="issue tracker-5 status-6 priority-4 priority-default closed" title="Misc: Prohibit a "foxtrot merge" instead of a merge commit (Rejected)" href="https://bugs.ruby-lang.org/issues/16093">#16093</a>].</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=807102019-08-13T12:36:55Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>While this feature is still 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...</p>
<p>Therefore, 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 <a class="issue tracker-5 status-6 priority-4 priority-default closed" title="Misc: Prohibit a "foxtrot merge" instead of a merge commit (Rejected)" href="https://bugs.ruby-lang.org/issues/16093">#16093</a>], a "Create a merge commit" is disabled. It's available only for master branch, and other branches are protected by CI.</p>
<p>Here's the summary:</p>
<a name="Whats-changed"></a>
<h2 >What's changed?<a href="#Whats-changed" class="wiki-anchor">¶</a></h2>
<ul>
<li>You can push "Squash and merge" or "Rebase and merge" button on a GitHub pull request, but only for master branch.</li>
<li>
<code>git push</code> to git.ruby-lang.org became slower, almost as slow as <code>git push</code> to GitHub. I'm really sorry about this.</li>
</ul>
<a name="Whats-not-changed"></a>
<h2 >What's not changed?<a href="#Whats-not-changed" class="wiki-anchor">¶</a></h2>
<ul>
<li>Committers should continue to use git.ruby-lang.org for usual <code>git pull</code> / <code>git push</code> destination.</li>
<li>Nothing is changed in branches other than "master".
<ul>
<li>"master" is the only branch which is synchronized bidirectionally.</li>
<li>"trunk" and "master" are mirrored each other (until 2020/1/1, as said in [Misc <a class="issue tracker-5 status-5 priority-4 priority-default closed" title="Misc: Make "trunk" a symbolic-ref of "master" on git.ruby-lang.org (Closed)" href="https://bugs.ruby-lang.org/issues/15843">#15843</a>]), 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.</li>
</ul>
</li>
<li>You cannot directly push to GitHub ruby/ruby master branch, except "admin" users.
<ul>
<li>We need to allow this to admin users because matzbot (admin) needs to sync commits to GitHub.</li>
<li>While <code>git push</code> to GitHub ruby/ruby master branch would work by bidirectional sync, to simplify the problem, admin should not push commits directly to GitHub.</li>
<li>"admin" users: ruby/ruby owners (<a class="user active user-mention" href="https://bugs.ruby-lang.org/users/94">@matsuda (Akira Matsuda)</a>, <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/572">@hsbt (Hiroshi SHIBATA)</a>, <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/18">@mame (Yusuke Endoh)</a>, <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/5">@naruse (Yui NARUSE)</a>), <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a>, and matzbot.</li>
</ul>
</li>
<li>You cannot use a merge button against non-master branches, except "admin" users.
<ul>
<li>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.</li>
</ul>
</li>
<li>A merge commit will never be created unless the above "admin" users intentionally push merge commits to a GitHub branch directly.</li>
</ul> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=807112019-08-13T12:57:01Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Subject</strong> changed from <i>Allow only "Rebase and merge" or "Squash and merge" on GitHub, and sync it on git.ruby-lang.org pre-receive hook</i> to <i>Allow only "Rebase and merge" or "Squash and merge" on GitHub master branch, and sync it on git.ruby-lang.org update hook</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/80711/diff?detail_id=54331">diff</a>)</li></ul> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=807162019-08-13T20:09:52Zioquatix (Samuel Williams)samuel@oriontransfer.net
<ul></ul><p>It's a good idea since it can save a lot of time for maintainers.</p> 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 hookhttps://bugs.ruby-lang.org/issues/16094?journal_id=824562019-11-04T15:44:26Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul><li><strong>Related to</strong> <i><a class="issue tracker-5 status-5 priority-4 priority-default closed" href="/issues/14632">Misc #14632</a>: [ANN] git.ruby-lang.org</i> added</li></ul>