fix: count LOC/files when passing multiple repos - #125
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #125 +/- ##
==========================================
+ Coverage 85.71% 89.76% +4.05%
==========================================
Files 3 3
Lines 392 391 -1
Branches 104 103 -1
==========================================
+ Hits 336 351 +15
+ Misses 45 31 -14
+ Partials 11 9 -2 🚀 New features to boost your workflow:
|
casperdcl
force-pushed
the
main
branch
2 times, most recently
from
July 31, 2026 17:08
9b44df1 to
19956fe
Compare
With more than one gitdir, `prefix_gitdir` is set and `_get_auth_stats` prefixed each filename with the gitdir before passing it to `git -C <gitdir> blame`, producing `<gitdir>/<gitdir>/<file>`. Every blame call then failed and was swallowed by the surrounding try/except, so the default `--loc=surviving` reported zero loc, files and ctimes (commit counts come from `shortlog` and were unaffected). The prefix is only needed for the reported name, so it is now applied to a separate `display_fname` used for logging and `stats_append`, while the repo-relative `fname` is passed to git. Adds a regression test running gitfame over two relative gitdirs.
casperdcl
force-pushed
the
fix/multi-repo-blame-path
branch
from
July 31, 2026 17:11
f5d5ed6 to
b99f118
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #64.
With more than one gitdir,
_get_auth_statsprefixed each filename with the gitdir before passing it togit -C <gitdir> blame, so git was asked for<gitdir>/<gitdir>/<file>. Every blame failed and was swallowed by the surroundingtry/except, leaving the default--loc=survivingwith zero loc/files/ctimes (commit counts come fromshortlog, which is why only those survived — matching @casperdcl's note that--loc=ins,delworks).The prefix is only needed for the reported name, so it now goes to a separate
display_fnameused for logging andstats_append, while the repo-relativefnameis passed to git. The added test runs gitfame over two relative gitdirs and fails onmainwithKeyError: 'loc'.This change was prepared with AI assistance; the regression test was run locally and fails without the fix.