git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH/RFC] diff --relative: output paths as relative to the current subdirectory
Date: Tue, 12 Feb 2008 15:43:51 -0800	[thread overview]
Message-ID: <7vfxvx211k.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.1.00.0802121531170.2920@woody.linux-foundation.org> (Linus Torvalds's message of "Tue, 12 Feb 2008 15:33:44 -0800 (PST)")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Tue, 12 Feb 2008, Junio C Hamano wrote:
>>
>> This adds --relative option to diff family.  When you start from
>> a subdirectory, 
>> 
>>  $ git diff --relative
>
> Ack, except I think it should allow you to actually *set* what the diff is 
> relative to.
>
> An example of that could be something like
>
> 	git diff --relative=drivers/scsi/ a..b -- drivers/scsi/
>
> where you aren't actually *in* that subdirectory, but for one reason or 
> another you're limiting the diff to just stuff in that subdirectory, and 
> want a diff that is relative to that one.
>
> Hmm?

Your example is shorter to type as:

	(cd drivers/scsi && git diff --relative a..b --)

Do you envision a useful case where --relative=<foo> does not
cover the pathspec you give?  IOW, with the "temporarily chdir
there" approach, you cannot express:

	git diff --relative=block/ a..b -- drivers/scsi

but I do not think it is useful.  On the other hand,

	git diff --relative=drivers a..b -- drivers/scsi

does make sense but again that is:

	(cd drivers && git diff --relative a..b -- scsi/)

So...

  reply	other threads:[~2008-02-12 23:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 22:26 [PATCH/RFC] diff --relative: output paths as relative to the current subdirectory Junio C Hamano
2008-02-12 23:33 ` Linus Torvalds
2008-02-12 23:43   ` Junio C Hamano [this message]
2008-02-12 23:53     ` Linus Torvalds
2008-02-13  0:09       ` Linus Torvalds
2008-02-13  1:19         ` Junio C Hamano
2008-02-13  8:33           ` Junio C Hamano
2008-02-13  0:59       ` Junio C Hamano

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=7vfxvx211k.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).