Page MenuHomePhabricator

Incorrect handling of merge commits
Closed, InvalidPublic

Description

I think that Phabricator does not correctly handle git merge commits. In my particular case, I am experiencing the following issue...

I had set up a Herald rule so that if anyone modifies an .arclint or .arcconfig file, it triggers an audit by myself. Now, I have a bunch of audits waiting for me because people merged a change that I had made to the .arcconfig into their branch, which was later merged back into master.

i.e. Someone is working on a branch X and merges master in X (bringing with it a change to the .arcconfig). Later, branch X is merged into master and I get triggered for an audit.

Event Timeline

joshuaspence assigned this task to epriestley.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a subscriber: joshuaspence.

I have the same issue when I enabled auditing on a directory using the "Owners" application. I am getting asked to audit merge commits containing changes I already made.

This appears to be part of a larger issue with how Phabricator treats merge commits. With a clean merge I get no output with "git show <commit_id>" on the command line, but when I go to that commit in phabricator I see all the changes.

I don't believe this report, but here goes:

  • I wrote a Herald rule to audit master.txt:

Screen Shot 2017-01-18 at 12.15.45 PM.png (1×1 px, 156 KB)

  • I created a commit on master affecting master.txt.
$ nano master.txt
$ git add .
$ git commit -am 'create master.txt'
$ git push
  • As expected, this triggered an audit.
  • I created a branch from HEAD^:
$ git checkout HEAD^ -b feature
$ nano some_other_file.txt
$ git add .
$ git commit -am 'feature'
  • I merged master onto the branch, explicitly creating a merge commit:
$ git merge master --no-ff
  • I merged feature back onto master, explicitly creating another merge commit:
$ git merge feature --no-ff
  • I pushed this commit.
$ git push
  • This did not trigger an audit:

Screen Shot 2017-01-18 at 12.39.04 PM.png (933×1 px, 181 KB)

If you're experiencing this issue or know what I did wrong, please file a new report that meets the modern standards of Contributing Bug Reports. In particular, we need detailed, step-by-step instructions which demonstrate this issue. I suspect that the word "merge" might be being used as shorthand for "cherry-pick", "rebase", "copy-paste the changes into my editor", etc? But I'm not exactly sure what's happening here, and the behavior I observed in the test case above is consistent with my expectations. This was also filed like 30 years ago so maybe things changed since then.

Per above, not sure how to reproduce this.