git-bisect

Identify the commit that introduced a test failure using git bisect.

1|1|Updated Jun 11, 2024
One-click install
npx skills add https://github.com/ag-grid/ag-shared --skill git-bisect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-bisect
Source: https://github.com/ag-grid/ag-shared/tree/main/prompts/skills/git-bisect
Command: npx skills add https://github.com/ag-grid/ag-shared --skill git-bisect

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identifies the exact commit that introduced a test failure or flaky behavior by methodically bisecting the git history using git bisect.

Core Features & Use Cases

  • Automated, phase-driven workflow that narrows down the culprit commit.
  • Supports both automated bisect runs and manual verification across a range of commits.
  • Handles complex repositories and worktrees by guiding environment setup and test execution.

Quick Start

Provide a bad ref, a good ref, and a test command, then run the bisect workflow to locate the culprit.

Frequently Asked Questions about git-bisect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find the exact commit that introduced a test failure in my git history?

Git bisect methodically narrows down the culprit commit by testing a range of commits between a known good ref and a bad ref. This automated workflow repeatedly checks out commits and runs your test command to isolate the failure.

What's the best way to automate debugging a flaky test across multiple git commits?

Automating flaky test debugging with git bisect requires a bad ref, a good ref, and an executable test command. The workflow then automatically checks out intermediate commits and executes the test command to identify the failing commit.

Can I use git bisect with manual verification instead of an automated test command?

Git bisect supports both automated bisect runs and manual verification workflows. You can manually mark each checked-out commit as good or bad, allowing you to inspect behavior interactively when an automated test command is not available.

Does git bisect work with worktrees and large repositories?

Git bisect handles complex repositories and worktrees by guiding environment setup and test execution. It navigates large commit histories efficiently, applying the automated or manual test workflow across the bisected range to locate the failure.

What do I need to set up before running a git bisect workflow?

Running a git bisect workflow requires the Git CLI to be available, a clean repository state, and executable test commands to verify failures. You must also provide a known bad ref and a known good ref to establish the search range.

Why does my git bisect workflow fail to start in a dirty repository?

Git bisect requires a clean repository state to successfully check out intermediate commits without conflicts. Uncommitted changes or untracked files will block the checkout process, preventing the workflow from isolating the failing commit.