Page MenuHomePhabricator

arc diff should support automatically splitting into multiple commits
Closed, DuplicatePublic

Description

Suppose I have a very large patchset, 20 commits or more. I am implementing a large refactoring, and each of these patches is an incremental step towards the result. (Concretely, the patchset we were dealing with was this one: https://ghc.haskell.org/trac/ghc/ticket/8199)

Arcanist's default behavior of squashing the patchset into a single one is wholly inappropriate, because as far as review is concerned, we really do want the incremental commits; that's how it was developed, and they're much smaller and easier to digest. But there are a lot of them, and it did not make much sense to develop them in isolation (i.e. many of the patches don't stand alone without the follow up patch. Example: a patch which renames symbols prior to changing their types so that out-of-tree relying on the symbols gets a symbol not defined error rather than a segfault.)

So really, what we want is to submit a separate CR for each patch. Unfortunately, Arcanist has no workflow for this. It is especially difficult because Arcanist does not know how to submit a patch if the patch in question is not HEAD.

One way to implement this workflow in Git is as follows:

  1. Run git rebase -i
  2. Edit the todo file so that we are going to edit all commits
  3. Repeatedly run arc diff and git rebase --continue until done

Something that is a bit annoying about this workflow is lint: if you weren't continually consulting arc lint while composing the patchset, Arcanist will now start bleating about all the lint warnings. But if you try fixing them, you may cause lots of spurious merge conflicts later on in the rebase.

Another thing is that this facility is very Git specific. I am not sure if this would generalize to other version control systems.

Event Timeline

ezyang raised the priority of this task from to Needs Triage.
ezyang updated the task description. (Show Details)
ezyang added a project: Arcanist.
ezyang added a subscriber: ezyang.