How can git bisect tell me which merge broke the master branch?
Asked Answered
R

1

5

Git bisect is branch aware, so it will usually happily venture into some branch to test those commits. I am not interested in whether the branch contains some bad commits. I am interested in whether or not merging a feature broke something, essentially the same as if I had squashed the entire branch into a single commit.

Is there a way I can instruct git bisect to stay on a given branch (right side, left side) so that I can figure this out?

The obstacle that I see is which branch to follow if going backwards, but there might be some way of handling that perhaps?

Ribwort answered 15/9, 2021 at 7:49 Comment(0)
O
6

That would be : git bisect --first-parent


The closest thing to "the commits of a given branch" in git is to take the sequence of leftmost commits from the head of that branch, and several commands (git log, git show and git bisect among others) accept a --first-parent option to represent that.

Olly answered 15/9, 2021 at 8:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.