World map

 

BM: Baca dalam Bahasa Melayu

World 10: Deep Git · Boss challenge

Detective: find the bug commit

You will learn: to track down the commit that broke a page, with bisect, a test and blame.

The problem

git log --oneline lists fourteen commits, from Add order page up to Update footer year. Terminal output: $ git log --oneline 0feda89 (HEAD -> main) Update footer year 51b7e6e Add closing day ea24e01 Add a footer 810fed2 Link the menu 7108bd9 Add phone number 7bb484d Clean up the form 387e919 Fix button colour 6187411 Add pickup time aabe367 Add halal note f0d9953 Reword the title 140a233 Add payment note eca4c56 Add a note box 9d62d7d Add a quantity box cc77188 Add order page

Emergency at Kedai Kancil! The Buy button is greyed out. Nobody can order kuih. Fourteen suspects. Find the guilty commit, detective!

Try it

Your clue is test.sh. It runs ! grep -q "disabled" order.html. When does the test pass?

Pick one answer.

Try it

Round 1: question the suspects. Run the test, then mark each commit good or bad.

The oldest commit works. The newest one is broken. Find the first bad commit.

The test: the Buy button in order.html must not be disabled.

  1. cc77188Add order pagegood
  2. 9d62d7dAdd a quantity boxmaybe
  3. eca4c56Add a note boxmaybe
  4. 140a233Add payment notemaybe
  5. f0d9953Reword the titlemaybe
  6. aabe367Add halal notemaybe
  7. 6187411Add pickup timemaybe
  8. 387e919Fix button colourmaybe
  9. 7bb484dClean up the formmaybe
  10. 7108bd9Add phone numbermaybe
  11. 810fed2Link the menumaybe
  12. ea24e01Add a footermaybe
  13. 51b7e6eAdd closing daymaybe
  14. 0feda89Update footer yearbad

Tests used: 0. For 13 commits, bisect needs at most 4.

Predict

“Fix button colour” sounds guilty. Was it?

Pick one answer.

Try it

Round 2: the real terminal. Start bisect, let test.sh judge every step, then go back to main.

cc771889d62d7deca4c56140a233f0d9953aabe3676187411387e9197bb484d7108bd9810fed2ea24e0151b7e6e0feda89

Check

git blame -L 6,6 order.html shows the button line, last changed by commit 7bb484d1, Clean up the form. Terminal output: $ git blame -L 6,6 order.html 7bb484d (You 2026-10-30 09:09:00 +0800 6) <button disabled>Buy</button>

Double-check the evidence. git blame -L 6,6 names the last change to the button line. Same suspect!

Check

The culprit is already shared with the team. What is your next move?

Pick one answer.

You did it!

You can now find the commit that broke something, like a detective.