Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo last diff in Phabricator

I have an open revision in Phabricator (with Git), and I submitted a diff to this revision, with the arc diff command.

The problem is that this diff is bad, and so I would like to undo it and to come back to the previous diff.

Do you know how can I do please?

like image 395
Arnaud Avatar asked Aug 04 '14 00:08

Arnaud


People also ask

How do you make a diff in Phabricator?

You can create a diff out of an arbitrary patch file by using --raw and piping it to stdin. In most cases this will only create a diff, not a revision. You can use the web UI to create a revision from the diff, or update an existing revision.

How do you use ARC patches?

apply changes in a revision to the working copy with arc patch. download a patch from Differential with arc export. update Git commit messages after review with arc amend. commit SVN changes with arc commit.


1 Answers

I often make the mistake of diff'ing against the wrong branch.

The first step is to undo the diff. We can't kill the diff from the revision history, but we can revert it.

$ arc patch --diff <diff_id> # last good diff, creates <arcpatch-branch>
$ arc diff --update <revision_id> <arcpatch-branch> # "reverts" the offending diffs to the current state

At this point your revision is back to its original state. If you want to perform the diff again then do what you normally do. Checkout the branch with the changes intended for the diff and then perform the diff.

$ git checkout <new_branch>
$ arc diff <source_branch> # new_branch has changes that is intended to be merged into source_branch

Credit to altendky who listed most of these steps. However, the revision flag he referenced no longer exists and I also wanted the steps to be listed a bit more clearly.

like image 200
seato Avatar answered Sep 20 '22 19:09

seato