Re: [PATCH 0/6] Introduce pathspec struct

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

 



Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes:

>>  $ git log --exclude "Doc*" master..pu -- '*.txt'
>>  $ git grep --exclude "t/" -e 'test .*-L' -- '*.sh'
>
> I was writing "but you would lose the ability to mix negative and
> positive pathspecs together, something like 'exclude Documentation
> except Documentation/technical'",...

I think that is way overengineered.  We _could_ make the expressions
arbitrarily complex and hard to use by using irregular syntax tricks, but
let's not go there.  Let's just keep things simple and usable instead.

 * Without pathspec, everything is included;
 * pathspecs will filter everything that do not match;
 * --exclude also filters what matches them from the remainder.

So...

> $ git log --exclude Documentation --exclude "!Documentation/technical"
> master..pu -- '*.txt'
>
> does not sound too twisted to understand (I hope).

...I would not vote for this.

> ... If David
> needs "git grep --exclude-dir" now, he should keep working on
> builtin/grep.c as he's doing now (maybe change --exclude-dir to
> --exclude).

That's not what I am saying.

Because --exclude-dir is a special case of --exclude, it would be an
efficient solution _if_ we can externally keep the command line option
compatible with GNU grep as a syntax sugar, and turn it into something
else internally that can be passed to your "pathspec with negative"
engine.


> ..., but his work on the
> command line interface _and tests_ won't be wasted.

Yup.
--
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]