简体   繁体   中英

Using git bisect to find the latest commit that doesn't build

I'm dealing with a repo where the latest commit build but the old ones don't. I tried using git bisect (which I'm new to) to find the latest commit that doesn't build.

I did

git bisect start HEAD non_buildable_commit
git bisect run ./test_script #run git bisect good if the build fails, bad if it suceeds

And I got bisect run success

How do I get the latest non-buildable commit now?

 git bisect start HEAD non_buildable_commit git bisect run ./test_script 

test_script : run git bisect good if the build fails, bad if it suceeds

That's not what the script is supposed to do. The script should exit with 0 if the commit is good (as defined by bisect) or with a code in 1-127 (except 125) if the commit is bad.

In your case, if the build fails, you should exit with exit 0 , otherwise something like exit 1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM