How to review a merge commit in differential?

Hi,

My team would like to create a git repo with “dev-stable” branches just as the phabricator repo https://secure.phabricator.com/source/phabricator/repository/master and periodic merge dev branch to stable branch. My question is is there any way to review the merge commit like https://secure.phabricator.com/rP686e51655bb0f4134780dcc68e0276bc9bd0a4af?

The main motivation to review a merge commit is to run some pre-commit tests to ensure the merge doesn’t break stuff on stable branch. While when I tried run arc diff on stable branch, it seems arc squash all commits on master into a single commit, which is not what we desired.

arc diff doens’t squash the commits (although it changes the message for the top-most commit); arc land does, by default.
You can use arc land --merge to have it produce a merge-commit rather then a squash commit.

thanks avivey, arc land --merge did the trick to land a merge commit.

While there is still a issue during the review phase, which make the reviewer feels bit of confusing. Here is what our workflow looks like:

  1. author perfer to promote dev to stable, so he run git merge dev --no-ff on stable branch. This commit merge 10 commits from dev to stable.
  2. author submit the merge-commit to review using arc diff that generate a patch e.g D1000,
  3. the reviewer or CI bot check out this patch using arc patch D1000, while this patch seems squash the 10 commits together so reviewer doesn’t know D1000 is a merge-commit, unless check the commit message contains ‘merge’ keyword.

Is there any method so reviewer aware D1000 is a merge-commit?

If you set up staging area, the CI can take take the change from there, in which case they get exactly what the author run arc diff on; arc patch doesn’t yet use staging areas, but it should be easy to replace it in your team with an alternative script (it’s basically git fetch <staging_area>/refs/tags/phabricator/diff/<diff_id>:refs/heads/D<revision_id>).

thanks, staging area is exactly what I’m looking for.

1 Like