Page MenuHomePhabricator

arc diff says "no changes" if I've pushed my branch to remote
Closed, InvalidPublic

Description

Not sure if this is a bug or just me missing a piece of the puzzle:

$ git checkcout -b my-new-feature
# hack hack hack
$ git status
# shows changes in the files
$ git push --set-upstream origin my-new-feature
$ arc diff
# fill out diff template
Usage Exception: No changes found. (Did you specify the wrong commit range?)
$ arc diff master
# works

I have the repo setup to track all branches and autoclose only on master. Is it the tracking that does this? I assumed that once you specify which default revision to diff against (the first time you run arc diff) arc diff would always try to diff against that revision "origin/master" in our case.

I realize the suggested workflow doesn't include pushing your branch to the remote, but old habits are hard to break, and most of the people on my current team do push to remote as part of their routine.

Ideally, I'd like to set it up so that arc diff will always act against origin/master unless someone explicitly specifies a revision or branch, so let me know if I've configured something incorrectly.

Thanks for phabricator, it's a great tool!

Related Objects

Mentioned Here
P1845 arc which

Event Timeline

gabe updated the task description. (Show Details)
gabe added a project: Arcanist.
gabe added a subscriber: gabe.

Can you show me what arc which says?

Does that output make sense in explaining what arc diff is doing, or not so much?

What did you expect arc diff to do?

Oh, I suppose you pretty much answered that:

Ideally, I'd like to set it up so that arc diff will always act against origin/master unless someone explicitly specifies a revision or branch, so let me know if I've configured something incorrectly.

To make arc diff do that, run this command:

arc set-config base 'git:merge-base(origin/master)'

(Then you can use arc which to explain the new behavior.)

This is documented here:

https://secure.phabricator.com/book/phabricator/article/arcanist_commit_ranges/

Your confusion is reasonable and this is something I want to improve, but there's a lot of historical context making it tricky to change since other users rely on the non-obvious, implicit, highly magical default rulesets.

Broadly, if no explicit base rule is configured telling arc what it should actually do, we try to guess a bunch of "reasonable" things, including the tracked upstream branch if one exists. The word "reasonable" here means "someone filed a feature request asking for it early in the lifecycle of the project before we got strict about not accepting this kind of stuff".

Specifically, I think I want arc to have this default behavior instead:

$ arc diff
Specify the beginning of the commit range you want to send for review, like this:

  $ arc diff <commit>

Use `arc which <commit>` to understand what `arc diff <commit>` will do.

To have `arc` select a range automatically, read "Commit Ranges" in the documentation.

Does that output make sense in explaining what arc diff is doing, or not so much?

Yeah, that makes sense, and I see why I was confused... thanks, I forgot about arc which.

gabe claimed this task.

Cool, thanks for the detailed response. I'll close this as *invalid* since it's expected behaviour.