Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
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

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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