Skip to content

fix: support variable-length abbreviated SHAs in blame matching - #77

Merged
aGallea merged 1 commit into
masterfrom
fix/variable-length-sha-matching
Mar 25, 2026
Merged

fix: support variable-length abbreviated SHAs in blame matching#77
aGallea merged 1 commit into
masterfrom
fix/variable-length-sha-matching

Conversation

@aGallea

@aGallea aGallea commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • parseBlameForCommits was hardcoded to truncate blame SHAs to 7 chars, but git log --format=%h produces variable-length hashes (7, 8, 9+ chars depending on core.abbrev / repo size)
  • When git produced 9-char abbreviations, the 7-char truncation caused zero matches — resulting in "No coverage details to present"
  • Now dynamically determines the abbreviation length from the commit set

Test Plan

  • All 87 tests pass (4 new tests for variable-length SHAs)
  • test: matches 9-char abbreviated SHA from git log
  • test: matches 8-char abbreviated SHA
  • test: does not false-match when abbrev length differs
  • test: handles empty commit set gracefully

🤖 Generated with Claude Code

git log --format=%h produces abbreviated hashes whose length depends
on core.abbrev and repo size (7, 8, 9+ chars). parseBlameForCommits
was hardcoded to truncate blame SHAs to 7 chars, causing mismatches
when git produced longer abbreviations — resulting in "No coverage
details to present".

Now dynamically determines the abbreviation length from the commit
set instead of hardcoding 7.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Tests Report 📄

Tests Success ✅

JUnit Details

Total Tests Failures Errors Skipped Time ⏳
87 0 0 0 19.87s

Coverage Details (100% >= 80%) ✅

Diff Cover Details
FileCovered LinesMissing Lines
src/diffCover.ts4/4100%
Total4/4100%

@aGallea
aGallea merged commit 1a271bb into master Mar 25, 2026
3 checks passed
aGallea pushed a commit that referenced this pull request Mar 25, 2026
### Bug Fixes

* support variable-length abbreviated SHAs in blame matching ([#77](#77)) ([1a271bb](1a271bb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant