From: Junio C Hamano <gitster@pobox.com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>,
Bo Yang <struggleyb.nku@gmail.com>,
David Ripton <dripton@ripton.net>
Subject: Re: [PATCH 0/6] Introduce pathspec struct
Date: Tue, 28 Sep 2010 21:26:42 -0700 [thread overview]
Message-ID: <7vzkv1qinx.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTinZ=dx1nBXTw0E=nLOmncsgNb7wv1-+ddWzPU+e@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Wed\, 29 Sep 2010 08\:31\:08 +1000")
Nguyen Thai Ngoc Duy <pclouds@gmail.com> 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.
next prev parent reply other threads:[~2010-09-29 4:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 23:21 [PATCH 0/6] Introduce pathspec struct Nguyễn Thái Ngọc Duy
2010-09-19 23:21 ` [PATCH 1/6] Add struct pathspec Nguyễn Thái Ngọc Duy
2010-09-27 22:19 ` Junio C Hamano
2010-09-29 6:11 ` yj2133011
2010-09-19 23:21 ` [PATCH 2/6] diff-no-index: use diff_tree_setup_paths() Nguyễn Thái Ngọc Duy
2010-09-19 23:21 ` [PATCH 3/6] pathspec: cache string length when initialize pathspec Nguyễn Thái Ngọc Duy
2010-09-27 22:19 ` Junio C Hamano
2010-09-28 1:08 ` Nguyen Thai Ngoc Duy
2010-09-19 23:21 ` [PATCH 4/6] Convert struct diff_options to use struct pathspec Nguyễn Thái Ngọc Duy
2010-09-27 22:19 ` Junio C Hamano
2010-09-19 23:21 ` [PATCH 5/6] tree_entry_interesting(): remove dependency on struct diff_options Nguyễn Thái Ngọc Duy
2010-09-27 22:20 ` Junio C Hamano
2010-09-28 22:00 ` Nguyen Thai Ngoc Duy
2010-09-19 23:21 ` [PATCH 6/6] Move tree_entry_interesting() to tree-walk.c and export it Nguyễn Thái Ngọc Duy
2010-09-20 8:31 ` [PATCH 0/6] Introduce pathspec struct Elijah Newren
2010-09-20 22:15 ` Nguyen Thai Ngoc Duy
2010-09-28 9:37 ` Junio C Hamano
2010-09-28 13:56 ` Bo Yang
2010-09-28 22:31 ` Nguyen Thai Ngoc Duy
2010-09-29 4:26 ` Junio C Hamano [this message]
2010-09-28 23:22 ` David Ripton
2010-09-29 4:29 ` 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=7vzkv1qinx.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=dripton@ripton.net \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.com \
--cc=struggleyb.nku@gmail.com \
/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).