How to get the commit range of a revision

I’m triggering a CI build for differential revisions using a Build-Plan and HTTP Request.
I get different information this way like buildable.revision, staging.uri, staging.ref, etc.
But how can I found out the Git commit range for this revision?
I would need this to find all the changed files for this revision.

I don’t see a git way of doing this, because the branch names don’t exist in the staging area and I also don’t know the merge base.

So I need to use some phabricator way. Also looking at arcanist I don’t see a command for getting that info.
Is there maybe some REST API to get the information from phabricator directly?
Or could this be added as additional arguments to the HTTP Request of the build plan somehow?


If you have a staging ref refs/tags/phabricator/diff/1234, you should have the base of the revision as refs/tags/phabricator/base/1234.

Fromt the conduit method, you can get a list of “related refs” ("refs"), which should include a base ref. You can get the Diff phid from the endpoint, if you only have a Revision id/phid.

1 Like

You are right. Somehow I overlooked this “diff” and “base” strings in the refs.
This is perfect and all I need.
Thanks a lot.