You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by Alexander Klimetschek <ak...@adobe.com.INVALID> on 2020/04/21 01:26:05 UTC

[DISCUSS] Allow merge commits on github repos?

Hi,

it seems all Openwhisk github repositories are configured to only allow "Rebase" and "Squash" options for the PR merge button. IIUC, the idea is to enforce linear histories and prevent "annoying" merge commit messages in the history.

I wonder if it could be changed so that:

  *   merge commits are allowed as well
  *   developers are strongly encouraged to use rebase or squash unless an exceptional case requires merge (see below)

WDYT?

Details:

There is a downside to preventing merge commits: in case there are concurrent branches, one cannot merge without conflicts. For example, I have been working on a couple of smaller PRs for wskdebug. Since I have to wait for reviews (might be > 1 day), I have been submitting multiple PRs in parallel, otherwise I would be super slow or would create monster PRs addressing multiple features/bugs in one that nobody wants to review ;-)

Sometimes I can't do them independently, but have to base one on top of the other. This might be if the first PR is some refactoring work, and the next PR must happen on top of that. Example PRs [1] and [2].

Unfortunately, this limitation leads to an unnecessary conflict when resolving the PRs: if the first PR is rebased/squashed onto master, the version history is rewritten, so the 2nd PR's changes will be seen as a conflict (in areas where the 2nd PR makes changes on top of the 1st PR).

This seems unfortunate, as git is well equipped to handle this (one of it's key features!).

I agree with preferring clean histories without a lot of "merge" commits on master. However, in some cases it's not avoidable without creating extra work and friction. In our in-house development we address this by allowing all options on PRs, but ask people to avoid merging unless necessary. This way you still avoid the majority of merge commits on master. Works fine.

[1] https://github.com/apache/openwhisk-wskdebug/pull/56
[2] https://github.com/apache/openwhisk-wskdebug/pull/58/

Cheers,
Alex

Re: [DISCUSS] Allow merge commits on github repos?

Posted by Alexander Klimetschek <ak...@adobe.com.INVALID>.
Step 2 leads to merge conflicts.

Cheers,
Alex

Cheers,
Alex
________________________________
Von: David P Grove <gr...@us.ibm.com>
Gesendet: Tuesday, April 21, 2020 6:26:13 AM
An: dev@openwhisk.apache.org <de...@openwhisk.apache.org>
Betreff: Re: [DISCUSS] Allow merge commits on github repos?

I'm missing why merge commits to master are needed to solve the problem you
are raising.

1. The first PR is merged with a `rebase and merge`
2. After updating your local master, you do a `git rebase master` to the
second PRs branch and force push.

--dave

Re: [DISCUSS] Allow merge commits on github repos?

Posted by David P Grove <gr...@us.ibm.com>.
I'm missing why merge commits to master are needed to solve the problem you
are raising.

1. The first PR is merged with a `rebase and merge`
2. After updating your local master, you do a `git rebase master` to the
second PRs branch and force push.

--dave