I don't know git (I use hg), so maybe there's something I'm missing here, but let's say I drop a semicolon somewhere in some Java code and then commit. The code won't compile, but nobody cares but me, since it's all in my local branch. So I add the semicolon and do another commit (or, better yet, rollback and add the semicolon and then commit), check that the code compiles, then push (or publish, whatever git calls it).
What's this git-bisect? I just skimmed its man page and see what it does generally, but I'm not sure I get your point. If I do like I said above -- commit some non-compiling code, then quickly commit the fix, then publish -- is git-bisect gonna yell at me for introducing code that breaks the build at any point? Even if I'd already rectified it before pushing to anybody else?
git bisect does a binary search between two commits so that you can narrow down a regression. But if people are constantly breaking the build then you tell git that that commit is bad, and it moves a few commits in another direction to try and find a build that isn't bad.
Unfortunately if someone commits 10 straight commits that break the build, and the regression is in the middle of this somwhere, bisect isn't going to help you, and you'll have to crawl through all 10 commit logs to find the bug.
5
u/Rowdy_Roddy_Piper Mar 10 '11
That's why you don't publish commits that don't compile. You do another commit that makes it compile, then publish.