An IDE extension that lets you track the complete history of any line of code or function without manually searching through git history.
-
Download the latest release:
-
Install in your IDE:
- Open VS Code / Cursor / Windsurf
- Press
Cmd+Shift+PorCtrl+Shift+P - Type:
Extensions: Install from VSIX - Select the downloaded
.vsixfile - Reload your IDE
-
Start using:
- Hover over any line of code to see git history!
- ✅ VS Code
- ✅ Cursor IDE
- ✅ Windsurf (Antigravity)
- ✅ VS Codium
- ✅ Any VS Code fork
Simply hover over any line of code to see:
- When it was last modified
- Who made the change
- The commit message
- Total number of times the line was modified
Right-click on any line and select "Show Line History" to see:
- All commits that modified that specific line
- Author information
- Dates (relative, like "2 days ago")
- Commit messages
- Branch information
- Full diff for each change
Right-click on a function and select "Show Function History" to:
- Track the entire evolution of a function
- See when it was created, modified, or removed
- View all commits that touched that function
- Understand how a function changed over time
- Simply hover your mouse over any line of code
- A tooltip appears showing the last commit that modified that line
- See author, date, commit hash, and message
For Line History:
- Click on any line of code
- Right-click to open context menu
- Select "Show Line History"
- A panel opens showing all commits that modified that line
For Function History:
- Click on a function definition
- Right-click to open context menu
- Select "Show Function History"
- See the complete evolution of that function
You find a bug in a function. Right-click → "Show Function History" to see:
- When was this function introduced?
- What commits modified it?
- Who can you ask about this code?
Wondering why a line exists? Hover over it to see:
- The commit message explaining why it was added
- When it was added
- Who added it (and you can ask them!)
Want to know when a function call was removed?
- Use git history to find the old code
- Use "Show Function History" on the old version
- See exactly when and why it was removed
During code review, quickly understand:
- How many times this code has been modified
- If it's touching frequently-changed code
- Historical context for the change
New to a codebase? Hover over unfamiliar code to:
- See recent changes and their explanations
- Identify code owners
- Understand evolution of critical sections
When you view line history, you'll see:
History for Line 42 in app.js
Found 5 commits
┌─────────────────────────────────────────────────┐
│ a3f2b1c4 2 days ago │
│ Fix validation logic for user input │
│ 👤 Jane Doe <jane@example.com> │
│ 🌿 main, origin/main │
│ ▼ View changes │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ 7c8d9e2f 2 weeks ago │
│ Add input validation │
│ 👤 John Smith <john@example.com> │
│ 🌿 feature/validation │
└─────────────────────────────────────────────────┘
...
The extension uses powerful git commands under the hood:
-
For Line History:
git log -L <start>,<end>:<file>- Tracks how specific lines changed over time
- Shows you every commit that touched those lines
-
For Function History:
git log -L :<funcname>:<file>- Git automatically tracks function boundaries
- Works for most languages (JavaScript, Python, Java, C++, etc.)
-
For Hover Info: Quick
git log -Lon the current line- Lightweight, fast lookup
- Cached to avoid repeated git calls
Line tracking works with all text files.
Currently, the extension works out of the box with no configuration needed.
Future configuration options could include:
- Custom git command timeouts
- Number of commits to show in hover
- Custom styling for commit display
- Branch filtering
- Hover: Very fast (<100ms) - only queries the last commit
- Line History: Fast (100-500ms) - depends on file history
- Function History: Medium (500ms-2s) - depends on function complexity and history
Git operations are performed on-demand, so there's no performance impact when not using the extension.
- Make sure you're clicking on a function definition
- Try manually entering the function name when prompted
- Some languages/syntaxes may not be recognized by git
- Wait a moment - git queries take time
- Check that the file has commit history
- Try right-click → "Show Line History" for full details
To modify or extend this extension:
-
Edit the code:
code ~/.vscode/extensions/code-history-tracker -
Key files:
extension.js- Main extension logicpackage.json- Extension manifest and commands
-
Testing:
- Press F5 in VS Code to launch Extension Development Host
- Make changes and reload the window to test
-
Adding features:
- Add new commands in
package.jsonundercontributes.commands - Implement handlers in
extension.js - Register commands in
activate()function
- Add new commands in
// Already implemented! See searchCodeHistory() function
// You can add a command to search for when specific code was added/removed// Modify executeGit() calls to add:
// --branches=feature/* to only show commits from feature branches// Add to git commands:
// --since="2 weeks ago" --until="1 week ago"- Blame annotations in gutter
- Time-travel view (see file at any commit)
- Compare function across branches
- Search for when code was removed
- Integration with PR/issue tracking
- Commit graph visualization
- Code ownership statistics
- Hotspot detection (frequently changed code)
MIT
Contributions welcome! This extension is designed to be simple and extensible.
Key areas for contribution:
- Better language/function detection
- Performance optimizations
- UI/UX improvements
- Additional git history queries
Made with ❤️ to make git history more accessible