-
-
Notifications
You must be signed in to change notification settings - Fork 953
-
I posted the same question on SO https://stackoverflow.com/questions/67109964/how-to-force-gitpython-to-ignore-global-git-configuration but i think it would make sense to repeat it here, being specific to the project.
While I was able to find an ugly workaround for forcing git to ignore its system or user configuration, I was not able to achieve the same while using gitpython.
GIT_CONFIG_NOSYSTEM=1 XDG_CONFIG_HOME=/ HOME=/ git ...
How can I achieve the same using gitpython library?
Note that I tried hacking os.environ but it appears to not work. If anyone wonders why I would want this is just because I want to have a portable is_dirty()
implementation, one that does not consider user ignores as I want developer to add required ignores if those are needed.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
More information would be required to answer this as it depends on how you are using GitPython.
In short, if repo.git.command(...)
syntax is used that can be affected with environment variables and behave accordingly.
If the built in method is used...
Line 667 in 651a81d
...a PR might be required to make it respect environment variables. It might already be possible to affect it by using this context manager though.
Line 872 in 651a81d
Beta Was this translation helpful? Give feedback.