copilot — ideas/git-history-detective
node v20
$ copilot --idea "Git History Detective"
beginner ⏱ 15-30 minutes Creative & General Projects
Investigate your git history like a detective — find bugs, trace changes, generate changelogs

The Problem

"When did this break?" "Who changed this file and why?" "What shipped in last week's release?" These questions come up daily, and the answers are buried in thousands of commits, PRs, and issues.

What You'll Build

A git investigation toolkit that lets you:
- Trace when and why any bug was introduced
- Generate beautiful changelogs from commit history
- Understand who owns which parts of the codebase
- Cross-reference commits with PRs and issues

Step-by-Step Walkthrough

Investigation 1: Bug Origin Story

$ "This function is broken: src/billing/calculate-tax.js
Use git log and git blame to find:
1. When was this file last changed?
2. What commit introduced the bug?
3. What PR was it part of?
4. Was there a related issue?"
For tricky bugs, ask Copilot to automate git bisect:
$ "Set up git bisect to find when the tests in
tests/billing.test.js started failing.
The last known good commit was 2 weeks ago on the main branch."

Investigation 2: Change Archaeology

$ "Show me every commit that touched the authentication module
in the last 6 months. Group by author.
Summarise the major changes in plain English."
$ "Create a timeline of the 20 most significant commits to this repo.
'Significant' means: large diffs, many files changed,
or commit messages mentioning breaking changes."

Investigation 3: Changelog Generation

$ "Generate a changelog from the last release tag to HEAD.
Group commits by category: Features, Bug Fixes, Performance,
Documentation, and Breaking Changes.
Use the PR titles where available (they're usually cleaner than commit messages).
Format as markdown suitable for a GitHub Release."

Investigation 4: Code Ownership Map

$ "Analyse git blame across the entire codebase.
For each top-level directory, show:
- Primary maintainer (most recent commits)
- Historical owner (most total commits)
- Bus factor (how many people have committed)
- Last activity date
Flag any area where only one person has ever committed."

Investigation 5: Release Forensics

$ "Compare the git diff between tags v2.3.0 and v2.4.0.
List every change that could affect users.
Flag any database migrations that were included.
Check if the changelog matches what actually shipped."

Pro Tips

• Copilot has full access to both `git` and `gh` CLI — it can cross-reference everything
• Use `--since` and `--until` flags to narrow down time ranges
• Ask for visual output: "Format this as a markdown table" or "Create a Mermaid timeline"
• This works best on repos with good commit messages — another reason to write them well

What You'll Learn

• Advanced git commands (blame, bisect, log with formatting)
• GitHub CLI for PR and issue querying
• Changelog generation best practices
• Code ownership and bus factor analysis