Re: [PATCH/RFC] diff --relative: output paths as relative to the current subdirectory

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

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> 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...
-
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]

  Powered by Linux