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.

  • 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). – Chris Johnsen Aug 7 '12 at 3:59
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.