Skip to content

Error on multiple git repos / recursive #113

@jgersdorf

Description

@jgersdorf

I get the following error when starting git fame with recursive option or with giving multiple git repos in command line:

Traceback (most recent call last):
  File "/Users/A1167272/.local/bin/git-fame", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/A1167272/.local/pipx/venvs/git-fame/lib/python3.13/site-packages/gitfame/_gitfame.py", line 532, in main
    run(args)
    ~~~^^^^^^
  File "/Users/A1167272/.local/pipx/venvs/git-fame/lib/python3.13/site-packages/gitfame/_gitfame.py", line 501, in run
    tabulate(auth_stats, stats_tot, args.sort, args.bytype, args.format, cost, args.enum,
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             args.min))
             ^^^^^^^^^
  File "/Users/A1167272/.local/pipx/venvs/git-fame/lib/python3.13/site-packages/gitfame/_gitfame.py", line 139, in tabulate
    (100 * s['loc'] / max(1, stats_tot['loc']),
                             ~~~~~~~~~^^^^^^^
KeyError: 'loc'

After investigating, I found the reason to be an error when calling git blame:

DEBUG:gitfame._get_auth_stats:300:blame_out: fatal: no such path crmt-adapter/cmd/crmt-adapter/main.go in HEAD

removing the lines

if prefix_gitdir:
fname = path.join(gitdir, fname)
helped

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions