Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bad-commit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For this exercise, the version is bad if `badfile` exists.

1. Start `git bisect`.
2. Usually the HEAD is "bad", as it is in this exercise. Use `git bisect bad` to indicate it.
3. Usually some old version will be good. In this exercise, the start version is. Use `git bisect good <commit-ish>` to indicate it.
3. Usually some old version will be good. In this exercise, the start version is `63e1df85cb135e97e562c8f15f883bb4e5137e8c`. Use `git bisect good <commit-ish>` to indicate it.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the commit hash exists and inspect its state

# Check if the commit exists in the repository
git rev-parse 63e1df85cb135e97e562c8f15f883bb4e5137e8c > /dev/null 2>&1
if [ $? -eq 0 ]; then
  echo "✓ Commit hash is valid"
else
  echo "✗ Commit hash not found"
  exit 1
fi

# Check if badfile exists at this commit
git show 63e1df85cb135e97e562c8f15f883bb4e5137e8c:badfile > /dev/null 2>&1
if [ $? -eq 0 ]; then
  echo "✗ WARNING: badfile exists at this commit (expected 'good' state)"
else
  echo "✓ badfile does not exist at this commit (expected 'good' state)"
fi

# Display commit info for context
echo ""
echo "Commit details:"
git show --oneline -s 63e1df85cb135e97e562c8f15f883bb4e5137e8c

Repository: eficode-academy/git-katas

Length of output: 424


🏁 Script executed:

#!/bin/bash
# More direct verification of the commit hash

echo "=== Checking commit existence in git log ==="
git log --oneline --all | grep "63e1df85cb135e97e562c8f15f883bb4e5137e8c" || echo "Not found in git log"

echo ""
echo "=== Checking with git rev-list ==="
git rev-list --all | grep "63e1df85cb135e97e562c8f15f883bb4e5137e8c" || echo "Not found in git rev-list"

echo ""
echo "=== Checking repository structure ==="
git log --oneline --max-count=20

echo ""
echo "=== Reading the README.md file to see context ==="
cat bad-commit/README.md | head -25

Repository: eficode-academy/git-katas

Length of output: 1442


The commit hash 63e1df85cb135e97e562c8f15f883bb4e5137e8c does not exist in the repository.

The verification shows this commit is not present in the git history (git log and git rev-list do not find it). Users cannot complete step 3 of the exercise because the commit reference is invalid. Provide a valid commit hash from the repository's actual history as the starting "good" state for the bisect exercise.

🤖 Prompt for AI Agents
In bad-commit/README.md around line 20, the specified "good" commit hash
63e1df85cb135e97e562c8f15f883bb4e5137e8c does not exist in the repository;
replace it with a valid commit from this repo by running git log or git rev-list
to find an appropriate earlier good commit and update the line to reference that
actual commit hash, preserving the instruction to use git bisect good
<commit-ish>. Ensure the new hash is present in the repository history and
matches the format used elsewhere in the README.

4. `git bisect` will then checkout various commits to find the bad commit. Continue indicating the state until it tells you the first bad commit. Keep track of this commit.
5. Run `git bisect reset` so we can work on the repository.
6. Use `git diff` to make sure that the bad commit only introduced `badfile`.
Expand Down