phabricator revision push to different git branch but not close the revision

27 Views Asked by At

Is there a way to land or push commits of a phabricator revision to a test git branch but not close the revision?

When developing a new complicate totally new feature code, I usually create a "WIP revision", in other words, a Work In Progress revision. It is nothing but the revision title prefixed with keyword "WIP". It is useful to review with teammates to make sure the coding is going correct, they can add comments. Finally when the code is fully complete, I remove the "WIP" from the title and make sure any comments are addressed and do arc land to land it on master branch.

During this WIP revision being reviewed by teammates, I also want to test the code by deploying in VM(Virtual Machine) or test K8s(Kuberentes) cluster, potentially looking for issues wrt performance, latency etc., as these are hard to simulate in local laptop. For getting this code into VM or k8s, it is easier to configure Git pull from a test git branch. The arc patching arc patch <revision-id> is complicated due to certain security configurations in our phabricator server.

In order to get the changes into a temporary test git branch, I can think of two ways, a. using git commands: git push origin my-test-branch, or b. using arc commands: arc land --onto my-test-branch.

However in both the cases the revision gets closed. But I want the revision to be open so that the feature can be continued to develop and teammates can review.

The phabricator revision gets closed to due to, in case of (a) the matching commit and tree hashes found in github, in case of (b) arc implicitely running arc close-revision (ref).

Is there some way to accomplish this just using arc commands itself, or should I use some git commands? One way I can think of is squashing the feature-branch commits into another branch generate a different commit hash than the ones seen in phabricator revision already and pushing that to github. Like,

git checkout master
git checkout -b my-test-branch

git merge --squash feature-branch

git commit -m "commiting feature-branch with commit tree changed to not close phabricator revision"

git push origin my-test-branch

Edit: Apparently this above git commands also resulted in closing the phabricator revision. Not sure how to workaround it, currently I can't think of any way.

0

There are 0 best solutions below