Page MenuHomePhabricator

arc diff --create failed to create revision
Closed, ResolvedPublic

Description

One of my developers created a review for a change in a branch, then pushed which closed the review. The change was then merged to another branch where a conflict happened. He resolved the conflict and attempted to create another review for the merge. He got an error indicating that the revision was already closed. He should be allowed to create a new revision for his merged code.

$ arc diff --create
You have untracked files in this working copy.

Working copy: /path/to/repo/

Untracked files in working copy:

path/to/file

Since you don't have '.gitignore' rules for these files and have not listed
them in '.git/info/exclude', you may have forgotten to 'git add' them to
your
commit.

Do you want to amend this file to the commit? [y/N] N

You have a saved revision message in '.git/arc/create-message'.
Message begins:

Fixing merge conflict.

You can use this message, or discard it.

Do you want to use this message? [Y/n] Y

Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
Exception
ERR_CLOSED: This revision has already been closed.
(Run with --trace for a full exception trace.)

Event Timeline

hlau raised the priority of this task from to Needs Triage.
hlau updated the task description. (Show Details)
hlau added a project: Arcanist.
hlau added a subscriber: hlau.

A workaround is to:

git diff X..Y | arc diff --raw

...and use the web UI for the rest of the workflow. It's also possible that arc which may be helpful.

This is not expected behavior, but it may be a little bit before I can look at it.

Had same error seems to have got confused by a cherry-pick, but also cool that you can create diffs like that didn't know

Ran into this same issue today and seeing this had no resolution I went over and tried to debug what the actual cause was.

What I found:

  1. arc which successfully reported that no revisions were found.
  2. They had 8 commits on the branch that was branched of master and was tracking it locally. At some point they must have merged another branch in or somehow added a commit to the branch that had a Differential Revision template (not sure of a better descriptor) attached to it.
  3. When they went to make the diff even with create they were somehow in a state where the template that it was bringing up already had Differential Revision: filled out with an already existing revision. Sorry I forgot to check if this was the same as the one that was listed in the commit log before deleting it.
  4. I rebased all the commits on his branch so that it was now only 1 ahead of master. I removed the Differential Revision field from the diff template and everything was ok again.

One commit per branch seems key to keeping users out of trouble and is the only workflow we currently support so I don't see this as a bug more of a user error that comes from some misunderstanding some part of git.

This should be safe to close as I think it's all user error.

I think we should ideally try to be more clear about the issue when the user passes --create, even if something in range says "Differential Revision: Whatever". That said "a little bit before I look at it" has been like two years now. Let me spend like 5 minutes on it and if it's a big mess we can just write it off.

Sounds good to me. This is the first link that comes up (Tested in incognito) when you search for ERR_CLOSED: This revision has already been closed and the second when you search ERR_CLOSED so documenting it here may fix most peoples issues.

epriestley claimed this task.

I'm not immediately able to get --create to bring up a template with "Differential Revision". Here's what I tried:

  • arc diff --create HEAD^ when HEAD has "Differential Revision: ...".
  • arc diff --create HEAD^^ when HEAD^ has "Differential Revision: ..." and HEAD is some other commit.

It sounds like the original state in your case is lost, too. And the other reports are ancient at this point, and didn't have details that give me any guesses.

So there's probably a legitimate bug of some kind here, but no one currently has a solid set of repro instructions, and triggering it requires some rare/complex setup that only happens a couple times per year.

If you're reading this as some future user who has run into this, we're happy to fix it if you can provide more detailed instructions on how to reproduce it, but merely having a revision identifier in the commit range doesn't seem to be sufficient and I wasn't able to guess or blunder my way into a reproduction case after trying a few things.

Until reproduction instructions manifest, I'm just going to close this, since we can't move forward on it and it seems reasonable to imagine we might fix it by accident before anyone comes up with a detailed reproduction case.

For anyone who gets here by searching for ERR_CLOSED: This revision has already been closed we had a similar problem.

We got into it by:

  1. Went through a standard arc diff and arc land
  2. That revision had a bug which needed to be rollback with a git revert, arc diff, and arc land
  3. Then, to get that code back, we created a new branch off master, did a git cherry-pick on the original SHA from #1 to that branch, and fixed that bug in another git commit on that branch
  4. Once the bug was fixed we tried arc diff and arc diff --create all of which said ERR_CLOSED: This revision has already been closed

The solution was to remove the "Differential Revision: " line automatically inserted by the arc diff. Once that was gone arc diff worked just fine.