Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • #3 is a moot point if you're running CI on every pull request, which you definitely should be. Commented Oct 26, 2024 at 18:00
  • 1
    @Alexander That's a good implementation of #3, definitely. At least as long as it's configured to actually test every submitted commit, not just the endpoint of a committed branch. I don't know whether every CI solution does this, though. It seems like a corner that's likely to be cut. Commented Oct 26, 2024 at 20:11
  • 2
    Well in GitHub's approach to git, commits shouldn't necessarily be green. The atomic unit of green changes is a pull request (and the corresponding merge commit it creates), not the individual commits themselves. It's perfectly reasonable to have an intermediate commit that isn't green, and even necessary in some cases. E.g. for big file moves+changes, the only way to preserve file history is to do the moves in a separate commit from the changes. They can't be squashed, otherwise the "file moved" heuristic fails, and they're seen as file deletions + new file creations Commented Oct 26, 2024 at 20:46
  • @Alexander Yeah, such commits can be a valid reason for a non-building commit. However, the result of every commit with actual changes should build with the test suite completing as expected. That's the only way that people can actually put git bisect to good use. The larger the gaps in buildability, the more involved the hunt for the actual cause of a recession. Commented Oct 26, 2024 at 20:55
  • It's lesser known, but that's where git bisect --first-parent comes in. It'll run only over the merge commits, which bisects at the PR level, rather than their constituent commits Commented Oct 26, 2024 at 21:17