Let's say Joe is working on a big task. He submits an initial revision of his work in a big PR with 20 commits. Now other developers spend a long time reviewing that PR and ask for a few changes/fixes. Joe now amends his commits with the requested changes and (force) pushes the new revision of the PR.
Now reviewers need to re-review the whole thing from scratch, even if the new changes were pretty minor. I haven't found a way to deal with this problem.
In the past, I've used Phabricator, which keeps track of every revision of a PR, so that you can diff changes between different revisions and solves this problem beautifully (https://secure.phabricator.com/D13641?vs=32966&id=32967#toc). For example, it lets you compare changes from revision 1 with revision 2 ). That way, you can only focus on reviewing the few new changes, rather than the 20 commits.
Is there a way we can accomplish something similar with Github? I imagine that there's a different workflow that we're not aware of. If not, do people have any alternatives to github? (apart from Phabricator?).
The only alternative I can think of is not amending commits, creating new commits instead and not force pushing. The problem with this is that the commit history becomes super messy, and there will be commits with bugs that are fixed in later commits.
Attaching below a capture of revision diffs in Phabricator, for those unaware of what I'm talking about.
thanks in advance for any advice!
I do not have an answer for GitHub.
What people sometimes do with the patch series (via email) workflow[1] is that they provide the output of git-range-diff(1) for each round of review after the initial one. More concretely that will mean that you store the state of your branch as a lightweight tag (store the initial “version 1”, store the “version 2” when you send that out, and so on). Then you can use that command:
They also describe how each series version is different from the preceding one.
For example, in this patch series, the author describes the current version as:
And the range-diff says that this is the only change:
How to use this on forges like GitHub
Like I said I have no GitHub-specific answer. So this will all be informal/manual procedure.
<branch-name>-v1
<branch-name>-v2
and force-push the changesNotes
git format-patch
andgit send-email
to send out proposed changes for review. First you send out an initial series, a “version 1”. Then when that has been discussed you send out a “version 2” based on that feedback, and so on until it gets included by whoever you want to include your changes.