Skip to content

GitConfigParser doesn't handle multiple includes #1418

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

Open
lkollar opened this issue Mar 28, 2022 · 1 comment
Open

GitConfigParser doesn't handle multiple includes #1418

lkollar opened this issue Mar 28, 2022 · 1 comment

Comments

@lkollar
Copy link

lkollar commented Mar 28, 2022

When more than a single include is listed in the git configuration file, the parser only picks up the last one.

Reproducer:

gitconfig.example

[include]
    path = ~/.gitconfig.local

[include]
    path = ~/.gitconfig.os
from git import GitConfigParser
p =  GitConfigParser("/home/lkollar/gitconfig.example")
p.read()
print(p.items("include"))
$ python test_gitpython.py
[('path', '~/.gitconfig.os')]

Tested with 3.1.27.

@Byron
Copy link
Member

Byron commented Mar 28, 2022

Thanks for letting me know and for the reproducer as well.

This should definitely work, and trying to fix it is likely to uncover more issues with the shoddy way this is currently implemented (based on the INI parser, I believe), in case someone wants to give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants