Search code examples
gitgit-flowphabricatorarcanist

Arc land fails: no commits on <feature-branch> which are not already present on target


More or less, I created this scenario on purpose:

# We use git-flow.
$ git flow feature start <feature>

# update a file
$ git commit <file> -m '<message>'
$ git rebase -i develop
$ git push -u origin <feature-branch>

# Try arcanist now
$ arc diff

# diff was accepted
$ git flow feature finish <feature>

# feature branch removed, now in develop, let's push
$ git push

So now I'm in a state where the branch is gone, and I cannot arc land due to the local branch being unavailable. NOTE: git (and gitolite) works just fine

$ arc land

Exception
Branch "<feature-branch>" does not exist in the local working copy.

/rant.. I don't see my feature branch in Phabricator's Maniphest. Why not?

I can pull that branch back:

$ git fetch -a
$ git checkout <feature-branch>

But I am still unable to land:

$ arc land
Landing current branch '<feature-branch>'.
TARGET  Landing onto "<feature-branch>", selected by following tracking branches upstream to the closest remote.
REMOTE  Using remote "origin", selected by following tracking branches upstream to the closest remote.
FETCH  Fetching origin/<feature-branch>...

Usage Exception: There are no commits on "<feature-branch>" which are not already present on the target.

And as far as I can tell, I have no recourse for closing that diff. How do I recover?


Solution

  • arc close-revision <Diff-ID> should close it. Basically you have two competing Git add-ons that are "landing" your changes. git flow feature finish <feature> already "landed" your changes so when you run arc land, it isn't able to perform its primary function of "landing" your changes.