Re:Keeping a project bisectable
by pca006132 on Friday August 05, 2022 @12:50AM
(#32351828)
Rebasing is not that complicated, usually. (if people sending PRs make sure their code is working for each commit)
[ Parent
| on HN ]
Yeah but the other problem in pull requests is that if someone makes changes since the last time I reviewed and then they force push I can’t see the difference from the last time I reviewed. Also if they rebase and push multiple commits there’s no guarantee they would all pass CI which means you can’t guarantee it will work with bisecting.
Re:Keeping a project bisectable
by LaLaLand122 on Friday August 05, 2022 @01:16AM
(#32352019)
> if someone makes changes since the last time I reviewed and then they force push I can’t see the difference from the last time I reviewed
You need better tools. Even in GitHub you can click on "force pushed" and see the diff.
> there’s no guarantee they would all pass CI
There wasn't any guarantee before, either. If you want that guarantee, make the CI build every commit.
> There wasn't any guarantee before, either. If you want that guarantee, make the CI build every commit.
Guarantee is the wrong word. The point is that if you always squash merge after passing the entire test suite you don’t have a bunch of potential garbage commits in history that you have to wade through when bisecting.
As for building every commit that’s probably a tough sell and a poor use of money for what benefit?
Re:Keeping a project bisectable
by __MatrixMan__ on Friday August 05, 2022 @01:38AM
(#32352154)
But if it's only gonna find monstrous feature-at-a-time commits, what good is a bisect anyway? I want the culprit commit to be 5 minutes of bad ideas, not 5 minutes of bad ideas mixed with three days of good ones.
Re:Keeping a project bisectable
by snovv_crash on Friday August 05, 2022 @02:25AM
(#32352464)
Make smaller PRs then. It's a lot slower to bisect if only some of the commits even compile.
Re:Keeping a project bisectable
by LaLaLand122 on Friday August 05, 2022 @03:56AM
(#32353038)
If the PR is small enough to naturally fit into a single commit the rebasing vs squashing multiple commits discussion disappears (just please don't merge it!)... there is a single commit.
Many developers make commits that are “wip” with messages to match. Maybe you commit before you go to lunch, or when you go home for the day. These are useless commits and should be rebased or squashed, but many of these same devs won’t do that unless you force them or the tooling does it for them automatically. A minority of devs build a clean history of commits that tells a story, carefully crafted over time (usually manufactured after the fact with liberal use of rebase). For these devs squash is awful. Unfortunately they are truly a minority and the majority ruins things for them.
That's fine. You're checking the difference between the current state of master and the current state of the feature branch, not the difference between the old state of the feature branch and the current state of the feature branch.
Force push doesn't delete the commit from your computer so you should still be able to diff between the (disjoint) commits using the hash.
If someone else has done the pull request, I review it on GitHub, then they rebase and force push the original commit wouldn’t be on my machine unless I had pulled it earlier correct? Which is something I never do.
If you don't have the ref locally but you have it open in a browser tab, you should† still be able to manually hack the URL to get a diff. Eg https://github.com/git/git/compare/95d1613a9fce4bcfc82d8ba48...
† My company's not on Github Enterprise and I don't have a repo and a second user handy to double check on public Github.