Skip to content

Author name returned as 'empty' #1852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wgruyter opened this issue Feb 29, 2024 · 1 comment
Closed

Author name returned as 'empty' #1852

wgruyter opened this issue Feb 29, 2024 · 1 comment

Comments

@wgruyter
Copy link

  • Using the linux torvald public GIT repository
  • Lookup a commit (several affected by this)
  • The python library returns an 'empty' author name, while the git cli command returns proper info

$ git show "03d661d3d7dd2c20330d775c13157419049f1617"
commit 03d661d3d7dd2c20330d775c13157419049f1617
Merge: 1a9505996dd0c12a2e56d2c6af00846e75a3850d fdecea66687d76c7d19be6559586df5c51023d11
Author: Jeff Garzik [email protected]
Date: Sat Jun 4 17:19:42 2005 -0400

Automatic merge of /spare/repo/netdev-2.6 branch starfire

$ python3
Python 3.9.18 (main, Jan 4 2024, 00:00:00)
[GCC 11.4.1 20230605 (Red Hat 11.4.1-2.1.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

import git
repo = git.Repo(".")
cmt = repo.commit("03d661d3d7dd2c20330d775c13157419049f1617")
cmt.author.name
''
cmt.author.email
'[email protected]'

$ git -version
git version 2.43.0

$ pip3 list
Package Version


gitdb 4.0.11
GitPython 3.1.42

@Byron
Copy link
Member

Byron commented Feb 29, 2024

The commit in question looks like this:

tree f4f85c70a56706b9966f24b638ffdfa6a9f98502
parent 1a9505996dd0c12a2e56d2c6af00846e75a3850d
parent fdecea66687d76c7d19be6559586df5c51023d11
author  <[email protected]> 1117919982 -0400
committer Jeff Garzik <[email protected]> 1117919982 -0400

Automatic merge of /spare/repo/netdev-2.6 branch starfire

When looking at the author it's clear that it indeed isn't set.

The reason git show works is because it can resolve the .mailmap file of the repository, something that isn't supported by GitPython which in this regard is more similar to git cat-file than git show.

As GitPython is in maintenance mode, this feature won't be added unless it's contributed. Thanks for your understanding.

@Byron Byron closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants