The value of a clean git history is often underestimated. I will explain one of the advantages based on the git bisect command.

  • danrotOP
    link
    fedilink
    13 months ago

    I agree that some stuff is easier when not squashing commits, but for the teams I’ve been working with I’ve felt that the pros of squashing outweigh the cons, but of course YMMV.

    But I didn’t know about git bisect skip, thanks for the tip! But sincere question: What happens if there are e.g. three adjacent broken commits? If I have skip all three of those and the error was introduced in one of them, then git cannot tell me which commit introduced the error, right?

    • @kevincox
      link
      13 months ago

      Yeah, if the problem was introduced in the skipped commits or the commit after the skipped commits git won’t be able to tell the difference. It it will only be able to know that it was one of those N+1 commits.

      But as long as most of your commits are green it should be easy enough to do the final narrowing.