Page MenuHomePhabricator

arc land does not stop when local is ahead of remote when using git
Closed, ResolvedPublic


When using git as the VCS, if I committed something on my local onto branch (master) and then switch to a review branch and run arc land. Both changes will be pushed to the remote.

When I looked at ArcanistLandWorkflow.php it looks like the only case we will set $local_ahead_of_remote is when git pull --ff-only --no-stat fails and it is a git/svn repo. Both conditions do not apply in this case.

More than that, using git pull assumes that the onto branch is setup to correctly track the remote onto branch which is not always the case.

Event Timeline

noyeitan2 assigned this task to epriestley.
noyeitan2 raised the priority of this task from to Normal.
noyeitan2 updated the task description. (Show Details)
noyeitan2 added a project: Arcanist.
noyeitan2 added a subscriber: noyeitan2.

Yeah, this is silly and we should definitely detect it. I think I assumed that the git pull would fail when I wrote it originally, but was mistaken in this case.

epriestley added a subscriber: epriestley.

In arc land, we should do this sort of logic after a successful pull, not just after a failed pull under git-svn:

list($out) = $repository_api->execxLocal(
  'log %s..%s',
if (strlen(trim($out))) {
  $local_ahead_of_remote = true;

Also, all of the user-facing strings in this file should be using pht() if you're feeling brave.