I'm using git with Arcanist. I know I can specify the commit range for creating differential revisions, but is there any arc rule by which arc can automatically determine the last commit not included in any revision?
let say this is my git tree
origin/master -> c1 -> c2 -> c3
at this point, arc diff results into creation of revision of c1, c2, c3. That's exactly what expected.
Now my reviews are pending and I started working on more stuff, so git tree will look like
origin/master -> c1 -> c2 -> c3 -> c4 -> c5 -> c6
this time arc diff will result into creation of revision of (c1, c2,.. c6) due to default ruleset. I want that arc diff should include only (c4, c5, c6) only.
I can achieve the same by using arc diff c4. But this situations is too frequent and doing arc diff <commit> is cumbersome because one have to do git log before that etc. So is there any ruleset in arcanist to handle that directly?
There is no such rule.
I don't think such a rule would work, anyway. If you did: commit A, arc diff, commit B, arc diff, it could not tell whether you meant to create a new revision or update the previous revision to include B.
The git:branch-unique() rule finds the last commit on different branches than HEAD. With this rule, you can distinguish between the two cases:
- commit A, arc diff, commit B, arc diff: create revision with A, then update it to include A + B.
- commit A, arc diff, create new branch, commit B, arc diff: creates a revision with A, then create a second revision with B
This also makes it easier to make changes to the revision with "A" later.
I think such rule can work. In case someone wants to update revision, an explicit --update will suffice. Also using branch-unique is indeed a nice way to do the same thing but that will increase the number of branches in local especially when someone is working on a feature branch and that code have to be reviewed a lot before landing into development branch.