News for hackers. Stuff that matters.
Re:Why some of us like "interdiff" code review systems (not ... by jrochkind1 on Wednesday September 11, 2024 @11:38AM (#41512398)
I realized reading the first part of this article that I often want to set up a sequence of PR's, for very similar reasons as in the begininng of OP. Say, a prefatory refactor, then the main work, then some data cleanup.

When I do this, the problem with rebase is that it kind of breaks the additional "next in sequence" PRs "on top", or at least requires (confusing to me) cleanup in all of them when I rebase the base.

Re:Why some of us like "interdiff" code review systems (not ... by shambulatron on Wednesday September 11, 2024 @03:43PM (#41514705)
Have you come across `git rebase --update-refs`? This automatically moves your "intermediate" branches during a rebase and sounds like it could be useful in your situation.
Re:Why some of us like "interdiff" code review systems (not ... by jrochkind1 on Wednesday September 11, 2024 @05:02PM (#41515310)
I have not! I'll try to check it out, thanks!

The git cli still scares me when I get off the familiar path. :(

Re:Why some of us like "interdiff" code review systems (not ... by dmurray on Wednesday September 11, 2024 @08:31PM (#41516539)
There's also `git rebase --onto`, which effectively does the reverse - you tell git you've already rebased the part of this branch that overlapped with the "intermediate" branch, and it just needs to take care of the rest.
Re:Why some of us like "interdiff" code review systems (not ... by Vinnl on Thursday September 12, 2024 @05:24AM (#41519040)
Oh that sounds exactly what I need to simplify the workflow I described for the multi-PR use case. I'm going to try that out today, I just happen to have a use case for it ready to go :)
Re:Why some of us like "interdiff" code review systems (not ... by jrochkind1 on Thursday September 12, 2024 @09:06AM (#41520467)
Wow, I knew of neither of these, thank you!

I'll have to take some time to experiment with both and make sure I understand howt hey work and any pitfalls!

I am definitely in the crowd that thinks git UX is pretty unintuitive and challenging, despite having used it for over a decade!

These sound like great plumbing for a github-style web UI that actually facilitates multi-step sequence PR's though...

Re:Why some of us like "interdiff" code review systems (not ... by dgfitz on Wednesday September 11, 2024 @07:00PM (#41516030)
> a sequence of PR's, for very similar reasons as in the begininng of OP. Say, a prefatory refactor, then the main work, then some data cleanup.

I would dislike this as a reviewer. Now I need to keep your stack of changes in my head, in order.

Just make the change and push it, if people can’t review the diff you have different problems.

Re:Why some of us like "interdiff" code review systems (not ... by jrochkind1 on Thursday September 12, 2024 @09:34AM (#41520766)
> Now I need to keep your stack of changes in my head, in order.

Agreed. In another comment in this thread, I said the problem with this was "And been frustrated that Github's interface does not make it very easy to make the sequence apparent or have good DX for the reviewers."

For this to work, we need better tooling support -- the reviewer having to keep track in their head is not good.

I'm not sure which of the realistic alternatives you are suggesting:

1. I could submit them all as one PR. But I _know_ it's too big to review well, I needed several steps to get there. Yes, this is the "different problem", but it's normal to sometimes need to take several reviewable steps to get to the outcome, right? The OP had a very common pattern for me: Refactor with no behavior change to set the stage and make the feature easily implementable; feature implementation; data migration.

2. I could submit the PR's one at a time, and not submit subsequent ones until the first are reviewed. But now I need to keep it all in my head, which my head isn't up to, and I not infrequentkly wind up messing up my branches. AND, sticking with that common case, the reviewer doesn't see what motivated the refactor, so I have to just explain it in words, and their like "Oh but I don't like this aspect of the refactor" and I have to be like "Yeah, okay, but if you could see how I used it to implmeent the feature you'd understand why"

Of course I end up doing one of these three paths (with the sequence of PR's made all at once being one of them) when this situation arises, having no other options. They are all unsatisfactory, agreed.

Re:Why some of us like "interdiff" code review systems (not ... by ants_everywhere on Wednesday September 11, 2024 @08:14PM (#41516443)
Gerrit supports this workflow. Patchsets can form a "relation chain."

One common workflow is you have a change of, say, 3-4 patches. You get code reviewed on them all, updating each patch set according to the reviews. Later patch sets can't be submitted until the earlier ones are. You can have tooling telling people not to review the later patch sets in the chain until the earlier ones have passed code review.