4

A git-interfaced tool written in Python breaks because of some settings in my local ~/.gitconfig, namely diff.noprefix=True.

I know that I can use something like git -c diff.noprefix=False diff in the call but I fear other things will break in other parts of the tool or on other setups. I have been looking for a --norc or -c /dev/null parameter but didn't find my way in the documentation.

1
  • 7
    Sigh. This is why programs built on Git should always use its “plumbing” interface (e.g. git diff-files, git diff-index, and git diff-tree) and not the “porcelain” interface (e.g. git diff). The plumbing commands disregard user-preference items like diff.noprefix, so the output formats are stable (across Git versions and also users). Commented Aug 7, 2012 at 3:59

1 Answer 1

4

Export a different value for HOME than your normal home directory. Git won't be able to find a ~/.gitconfig there (or can find a new one you define, which is missing the offensive parameter). Looks like you can also set a GIT_CONFIG_NOSYSTEM export to decline usage of /etc/git.config, too.

Further details in this gmane thread.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .