-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the common rebase case easy #81
Comments
The main problem with tracking rebases is that it's hard to match commits. What we can do is allow rebases:
Within this subset of rebases, we can reliably track how the commits have changed since the commit messages are unchanged (or trackable in some form) With this in mind, for cases where a commit is edited, instead of showing a merge view (which is confusing to review), we can instead show how the individual commit has changed (diff of a diff, effectively) |
When devs push directly to critic, the Fiddle&Tweak extension can be used to make pure "history rewrite" rebases (no actual changes, just changed commits msgs, squashes, squashed fixups etc) and conflict free "move rebases" (moving to a new upstream) super convenient. However, when critic reviews are tracking external branches (like in your case), it's more complicated as you point out. Internally at Opera we have both kinds of teams, but the folks that use reviews tracking external branches they never force push (overwrite) those branches instead they push a new version of the branch with a certain kind of suffix and (I think) we have some custom hooks that makes it work. However, that wouldn't work well with the standard github PR workflow. I'm personally not using the github integration, so fixing this is not at the top of my list atm, but having some kind of solution to this built into, not just the slightly customized critic instance that james runs, but to upstream critic would be great indeed. |
So FWIW I think that GH always supplies me with the base of a review. Using this information I think I can make the rebase situation better in the following steps:
I am at step 2 currently. Step 3 is easy once I work out whether the current changes actually work. Step 4 is harder, particularly because it's unclear how to invoke the rebase logic from the branch tracker. |
If the GH integration was implemented as an extension, you could've copied what the FiddleAndTweak extension does when it rebases a review, which is to disable the tracking, prepare the rebase, push (--force) directly to Critic's repository and then re-enable the tracking. See https://github.com/jensl/FiddleAndTweak/blob/master/operationPerformRebase.js, lines 120-157. But then again, that push can sometimes take a while to complete, so probably isn't something you want to do synchronously while handling the update notification from GH. It shouldn't be too hard to make the branch tracker do this; you just need to inserting a row into the reviewrebases table and then push with --force. In theory, that row could be inserted somewhere else (i.e. the rebase could be prepared somewhere else) and then the branch tracker could just check if a rebase has been prepared, and if so push with --force. You'd need to do something about https://github.com/jensl/critic/blob/master/src/index.py#L600 too, but you can just remove it. It's about completely refusing to rebase reviews via the branch tracker, and you want the opposite of that, after all. |
In my experience using Critic for Servo, the common case is that the rebased commits are just being shifted to a more recent base revision, and we could easily automate the process of rebasing the review by matching the commit messages against the old commits and finding the first one that is different. This would make the process a lot easier for our contributors - Critic is a constant pain point for any nontrivial first-time contributions from a newcomer.
The text was updated successfully, but these errors were encountered: