From: Junio C Hamano Date: Sun, 21 Dec 2014 22:46:16 GMT Subject: Re: [PATCH v2] git-config support for diff.relative setting Message-ID: In-Reply-To: <54972281.9050603@shysecurity.com> kelson@shysecurity.com writes: >> "Philip Oakley" wrote: >> Shouldn't this `(identical to "git diff --relative")` also be >>included in the documentation change? It would truly clarify the >> intenbt for the reader. > > Updated as follows: > +diff.relative:: > + Show pathnames relative to the current directory and exclude > + changes outside this directory; equivalent to the 'git diff' > + option '--relative'. > >> "Junio C Hamano" wrote: >> There should be a way to run non-relative diff in a repository that >> has the configuration set, perhaps by overriding with some command >> line option (e.g. "--no-relative"). > > Good idea; I'll put together a second patch for a "--no-relative" > option to disable diff.relative. The order should be first to add --no-relative, which should allow you to say $ alias gd "git diff --relative" $ gd --no-relative which would expand to "git diff --relative --no-relative" to defeat the earlier one on the command line, and then add diff.relative in the second patch, I would think. A natural consequence of the latter would be that these would steps work as expected: $ git config diff.relative no $ git diff $ git diff --relative $ git diff --no-relative $ git config diff.relative yes $ git diff $ git diff --relative $ git diff --no-relative which should be tested in a new set of tests added to t4045. For the first patch, I would expect a new set of tests added to t4045 to check at least the following: $ git diff --no-relative $ git diff --no-relative --relative $ git diff --relative --no-relative Thanks.