git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ripton <dripton@ripton.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	git <git@vger.kernel.org>, Bo Yang <struggleyb.nku@gmail.com>
Subject: Re: [PATCH 0/6] Introduce pathspec struct
Date: Tue, 28 Sep 2010 18:22:02 -0500	[thread overview]
Message-ID: <4CA2789A.7090306@ripton.net> (raw)
In-Reply-To: <7v7hi6us35.fsf@alter.siamese.dyndns.org>

On 09/28/10 04:37, Junio C Hamano wrote:

>   - David's "git grep --exclude-dir D" topic should be able to internally
>     use the same negative pathspec mechanism.  At the command line level,
>     it allows (and needs to allow) only the leading prefix (which is how
>     GNU grep's --exclude-dir works), but it makes tons of sense for us to
>     allow "--exclude $pattern" from the command line, and share the
>     mechanism internally between the two.

I don't think GNU grep's --exclude-dir only allows the leading prefix. 
Here the data directory is a level below the top, but --exclude-dir=data 
effectively excludes it:

$ grep -R behemoth_green *
Binary file slugathon/util/colors.pyc matches
slugathon/util/colors.py:    "behemoth_green": (2, 129, 2),
Binary file slugathon/data/creaturedata.pyc matches
slugathon/data/creaturedata.py:"Behemoth": ("Behemoths", 8, 3, 0, 0, 
"creature", 0, 0, 18, "behemoth_green"),
slugathon/data/creaturedata.py:"Cyclops": ("Cyclopes", 9, 2, 0, 0, 
"creature", 0, 0, 28, "behemoth_green"),

grep -R --exclude-dir=data behemoth_green *
Binary file slugathon/util/colors.pyc matches
slugathon/util/colors.py:    "behemoth_green": (2, 129, 2),

IMO it's useful to allow excluding directories below the top like it 
currently does, because some projects might have a bunch of noise 
directories with the same name, and having --exclude-dir exclude them 
all would be handy.

That said, if consistency with other exclude patterns is more important 
than this use case, fine with me.

-- 
David Ripton    dripton@ripton.net

  parent reply	other threads:[~2010-09-28 23:22 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
2010-09-28 23:22   ` David Ripton [this message]
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=4CA2789A.7090306@ripton.net \
    --to=dripton@ripton.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).