Re: teach git diff -v/--invert-match?

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

 



On Fri, Aug 22, 2008 at 09:51:16AM -0500, Brian Ericson wrote:

> I'm wondering what it would take to teach git diff to invert the -S  
> string (like git grep).

I think you would have to figure out the desired semantics first.

> I'm finding git diff -S<string> [--pickaxe-regex] to be really useful,  
> but find I have cases where I want to ignore differences.  For example, I 
> might not care if the only changes to a Java file, for example, are  
> related to import statements.  I'd like to be able to do something like  
> "git diff -S'^import' --pickaxe-regex -v".  I'll admit I can get by with  
> something like "git diff -S'^[^i]' --pickaxe-regex", but am pining for  
> -v/--invert-match.

I would have thought "-v" meant "match any changes which do not have
this pattern". But you want "match any changes that have any line which
does not have this pattern."

IOW, mine would not match any changes which used an import statement,
whereas yours would not match any changes which are _only_ import
statements.

-Peff
--
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