Page MenuHomePhabricator

Arc Diff displays file comparison backwards after a merge resolution
Open, Needs TriagePublic

Description

Hey guys,

I was working on updating a differential when some other code was pushed. I git-merged in the changes and had some conflicts, resolving them pretty easily. The differential confusion occured when I finished the git-merge and immediately submitted the update to the differential. The code displayed seemed to have been ignoring my manual merge resolution and wasn't reflecting the current state of code, instead showing the change as backwards from what was on the common branch and my local copy of the branch.

my .arcconfig looks like this with some names redacted

{
  "project.name" : "MY-PROJECT",
  "phabricator.uri" : "MY-URI",
  "arc.land.onto.default" : "COMMON-BRANCH",
  "base": "git:merge-base(origin/COMMON-BRANCH), arc:upstream, git:HEAD^"
}

I was wondering if I did something incorrectly, or if this is a bug. Thanks for any explanations you might offer!

Event Timeline

e-m-albright raised the priority of this task from to Needs Triage.
e-m-albright updated the task description. (Show Details)
e-m-albright added a subscriber: e-m-albright.

Can you show me the output of arc which, when run in a working copy in the same state from which you ran arc diff and got unexpected results?

certainly.

again this is slightly edited to remove names, the branch in question is called develop

C:\[source-dir]>arc which
REPOSITORY
To identify the repository associated with this working copy, arc followed this process:

    Configuration value "repository.callsign" is empty.

    Configuration value "project.name" is set to "[code]", but this project is
    not associated with a repository.

    This repository has no VCS UUID (this is normal for git/hg).

    The remote URI for this working copy is
    "ssh://[uri]/diffusion/[CODE]/[code].git".

    Found a unique matching repository.

This working copy is associated with the [CODE] repository.

COMMIT RANGE
If you run 'arc diff', changes between the commit:

    abd09676fb35c063  Merge branch 'someone-elses-develop' of ssh://[uri]/diffusion/[CODE]/[code].git into develop

...and the current working copy state will be sent to Differential, because
it is the merge-base of 'origin/develop' and HEAD, as specified by
'git:merge-base(origin/develop)' in your project 'base' configuration.

You can see the exact changes that will be sent by running this command:

    $ git diff abd09676fb35c063..HEAD

These commits will be included in the diff:

    36afe0f1e74f3b58  Merge branch 'develop' of ssh://[uri]/diffusion/[CODE]/[code] into develop
    0e38acac35aea46d  Merge branch 'develop' of ssh://[uri]/diffusion/[CODE]/[code] into develop
    28cfd4da44273bd4  [commit-message]
    35ffdc8cd5b2abf7  [commit-message]
    87600f20841f2159  Merge branch 'develop' of ssh://[uri]/diffusion/[CODE]/[code] into develop
    6f4917783d57b36d  [commit-message]
    7ffede3f5b5a0cd6  [commit-message]
    1473ec3208d10fdf  [commit-message]
    32cffaf147eb96ab  [commit-message]
    dc160ee7930b8299  [commit-message]
    7c24c3360cbabb79  [commit-message]


MATCHING REVISIONS
These Differential revisions match the changes in this working copy:

    D79 [diff-title]
        Reason: Commit message for '7c24c3360cbabb79' has explicit 'Differential Revision'.

Since exactly one revision in Differential matches this working copy, it will
be updated if you run 'arc diff'.


C:\Users\i-ealbright\codes\[code]>

when I ran arc diff --create the issue resolved itself in a new diff which looked good but this is still mysterious.

If you run git diff abd09676fb35c063..HEAD, do you get the diff you expect?

Are you able to repro it at all now? (You can try creating diffs with --only to avoid having to do all the update/reviewers stuff.)

Aha, interesting.

I can't tell exactly if git diff abd09676fb35c063..HEAD gives me the right diff as it's quite large.

I have reproduced the issue but I noticed that it only occurs when I move from viewing the entirety of the difference in the "Revision Update History" (Base to latest Diff update) to just the diffs surrounding the merge resolution. The entire diff view shows the correct state of the code, but again the diffs for the merge resolution seem flipped. I have reproduced this with yet another merge/conflict resolution and arc-diff submission.