Re: [PATCH 0/6] Introduce pathspec struct
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 29, 2010, 04:26 UTC
- Message-ID
- <7vzkv1qinx.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <AANLkTinZ=dx1nBXTw0E=nLOmncsgNb7wv1-+ddWzPU+e@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 6 quoted lines
>> $ 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.