Challenge - 5 Problems
Git Bisect Automation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of git bisect run with a simple test script
You run
git bisect run ./test_script.sh where test_script.sh exits 0 if the commit is good and 1 if bad. What will be the final output after bisect completes?Git
git bisect start # Assume bad commit is HEAD, good commit is v1.0 # test_script.sh returns 0 on good, 1 on bad # git bisect run ./test_script.sh
Attempts:
2 left
💡 Hint
Think about what git bisect run does when the test script returns 0 or 1.
✗ Incorrect
git bisect run uses the test script exit code to mark commits as good (0) or bad (1). It automatically finds the first bad commit and outputs it.
🧠 Conceptual
intermediate1:30remaining
Purpose of git bisect run
What is the main purpose of using
git bisect run in a git repository?Attempts:
2 left
💡 Hint
Think about how automation helps in finding bugs in commits.
✗ Incorrect
git bisect run automates the process of running a test script on each commit during bisect to find the first bad commit.❓ Troubleshoot
advanced2:00remaining
Why does git bisect run stop unexpectedly?
You run
git bisect run ./test_script.sh but bisect stops after a few commits with the message: error: test_script.sh: command not found. What is the most likely cause?Attempts:
2 left
💡 Hint
Check the permissions and location of the test script.
✗ Incorrect
If the test script is not executable or not found in the current directory or PATH, git bisect run cannot execute it and stops with an error.
🔀 Workflow
advanced2:30remaining
Correct sequence to use git bisect run
What is the correct sequence of commands to use
git bisect run to find a bad commit?Attempts:
2 left
💡 Hint
Start bisect, mark bad, mark good, then run the test script.
✗ Incorrect
You must start bisect, mark the current commit as bad, mark a known good commit, then run the test script to automate bisect.
✅ Best Practice
expert3:00remaining
Best practice for writing a test script for git bisect run
Which of the following is the best practice when writing a test script to use with
git bisect run?Attempts:
2 left
💡 Hint
Check git bisect run exit code conventions.
✗ Incorrect
git bisect run expects the test script to exit 0 for good, 1 for bad, and 125 to skip the commit if the test cannot be run.