Part of the Git, Zero to Hero
Build & submit taskBetaintermediate

Bisect Hunt: Find the Commit That Broke the Totals

A café kiosk's totals went wrong somewhere in 60 commits, and for three of them the code doesn't even build. Write a test script for git bisect run that skips broken builds, find the culprit, revert it, and explain the bug. A local self-check verifies your script, every answer in your bisect log and the fix, and writes your submission for instant, rubric-based feedback.

40 min

Est. time

3

Outcomes

4

Rubric criteria

60%

Pass score

What you'll learn

Skills you'll have real reps in after shipping this.

git bisect run turns a script's exit code into an answer: 0 good, 1 to 127 bad, 125 skip, 128 or more stop.
A commit that fails for an unrelated reason must be skipped, or bisect blames the wrong commit.
Each answer halves the suspects, so 60 commits take about six or seven tests.

The scenario

Bean There's order kiosk adds up orders at the counter. Since some point after v1.0, a few totals come out a penny or two short, and customers have noticed.

Sixty commits by three people have landed since v1.0. In the middle of them, a file move broke the build for three commits. You have a build script, a test suite that fails today, and no idea which commit is to blame.

Your role

You are the developer on call. Your deliverable is a bisect-test.sh that git bisect run can trust (125 for an unbuildable commit, 0 for passing tests, 1 for failing ones), the saved log of a bisect that names the right commit, a revert of that commit on main with the tests passing, and notes explaining what went wrong.

Start the task to unlock the full brief

You'll get the step-by-step requirements, setup commands, the 4-criterion grading rubric, tips, and the ability to submit your solution for instant AI grading.

Free to start · submit when you're ready

Find a bug with git bisect run, hands-on

git bisect finds the commit that broke something by halving the suspects with every test, and git bisect run lets a script do the testing. The catch: a commit that fails for an unrelated reason, such as a broken build, has to be skipped, or bisect blames the wrong commit. This kit gives you a small order kiosk with 60 commits, a failing test suite and three commits that don't build. You write the test script, exit 125 included, let bisect find the culprit, revert it and explain the bug. A local self-check runs your script at chosen commits, verifies every answer in your bisect log against the history, and writes your submission only when everything genuinely passes. It is the Level 8 project in Preporato's Git course.

Frequently asked questions

What does exit code 125 mean in git bisect run?

That the commit can't be tested, for example because it doesn't build. Bisect skips it and tests a commit nearby instead. 0 means good, 1 to 127 (except 125) mean bad, and 128 or more stop the bisect.

Do I need to know shell scripting?

Only a little: the script is three lines that run the build, exit 125 if it fails, and otherwise run the tests. The lesson on bisect shows the same pattern with a one-line check.

Why does check.sh create worktrees?

To run your script at specific commits without touching your kiosk folder: each check gets a temporary checkout of one commit, exactly as bisect would run it, and removes it afterwards.