githubteacher / githubfordevelopers-april

GitHub for Developers Training
4 stars 11 forks source link

bisect question #150

Closed welchn closed 7 years ago

welchn commented 7 years ago

With each bisect, is he "halving" the commits toward the end he specifies? So "git bisect bad" looks at the half-way object between current pointer and "bad"?

brianamarie commented 7 years ago

@welchn Close - Defining both 'bad' and good' gives the parameters. This is the range in which we know something is broken. Then, you're right - it halves the commits, runs the tests, and based on that information, halves one of the halves, etc. Does that make sense?

welchn commented 7 years ago

Mostly...If you are manually typing "bisect" like in his first example, how do you know if you should type "git bisect bad" or "git bisect good"? How do you know when you are done?

brianamarie commented 7 years ago

how do you know if you should type "git bisect bad" or "git bisect good"?

@welchn AH, I understand how. So when it pauses and waits for you to say git bisect good or git bisect bad, you would run a test. For us, the test was basic: ls. But, the tests can be as complex a the tests you would normally be running.

In reality, you would know something is broken before running git bisect, so you might use the same test that found the error during the bisect process.

How do you know when you are done?

Git will tell you when you're done - it will list one commit that is responsible based on the input you'd given it along the way.

Does this clarify?

welchn commented 7 years ago

Perfect, thanks!