Re: [PATCH v2] git-config support for diff.relative setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



kelson@xxxxxxxxxxxxxxx writes:

>> "Philip Oakley" <philipoakley@xxxxxxx> 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" <gitster@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]