git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: kelson@shysecurity.com
Cc: Philip Oakley <philipoakley@iee.org>,
	Git Mailing List <git@vger.kernel.org>,
	Duy Nguyen <pclouds@gmail.com>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH v2] git-config support for diff.relative setting
Date: Sun, 21 Dec 2014 14:46:16 -0800	[thread overview]
Message-ID: <xmqqppbcbozr.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <54972281.9050603@shysecurity.com> (kelson@shysecurity.com's message of "Sun, 21 Dec 2014 14:41:53 -0500")

kelson@shysecurity.com writes:

>> "Philip Oakley" <philipoakley@iee.org> 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@pobox.com> 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.

      reply	other threads:[~2014-12-21 22:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-20  9:24 [PATCH v2] git-config support for diff.relative setting kelson
2014-12-20 14:32 ` Philip Oakley
2014-12-21  2:58   ` Junio C Hamano
2014-12-21 19:41     ` kelson
2014-12-21 22:46       ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqppbcbozr.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=kelson@shysecurity.com \
    --cc=pclouds@gmail.com \
    --cc=philipoakley@iee.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).