ManualChanges and reviews
Changes and revisions
A change keeps its number even if you rewrite the commit. How does Berrit know the two versions belong to the same review?
What does a change number identify?
Section titled “What does a change number identify?”Suppose you’ve sent a --timeout flag for review, and Berrit has given it change #42. You and your reviewer can keep that page open for the whole discussion. It keeps track of what you’ve sent and what the reviewer thought of each version.
Each version is a revision, and there’s one Git commit for each revision. The code you first sent is revision 1. Your reviewer asks what a timeout of zero does. You make zero disable the timeout, write a test and push the fix. Git gives that commit a different SHA, but in Berrit it’s revision 2 of the same #42. In Files, your teammate can compare the two revisions and go straight to the fix.
How does Berrit recognise an update?
Section titled “How does Berrit recognise an update?”If you sent the branch as One change, you can make the fix in a new local commit and push it to the same branch. While the change is open, Berrit combines the commits on that branch into a single revision for the reviewer. You don’t need to squash your local history just to reply to a review. Send your first change.
If you sent a change per commit, a second commit with a new change ID gets a review of its own. To answer feedback on #42, edit the commit you sent for #42. In jj, find its change ID in jj log and use jj edit <change-id> before making the fix. In Git, if that commit is at the tip of your branch, stage the fix and use git commit --amend, keeping the Change-Id trailer in the message. Send the updated commit for review again. The Git SHA can change because Berrit recognises the change ID. If the fix really does deserve a separate review, give it a new commit in the stack.
Does a new revision need another approval?
Section titled “Does a new revision need another approval?”What matters here is the patch, the difference between the commit and its parent. If you rebase the same patch onto a newer parent, Berrit can see that your reviewer has already approved it. Their approval still counts.
Changing what --timeout does for zero changes the patch itself. By default, Berrit keeps approvals after an edit too. A repository can set approval_after_edit = "reset" if the team wants someone to approve the edited patch again.
When you’ve finished the fixes and want your reviewers to see them, choose Return to reviewers. Review a change.