GNU bug report logs - #21027
--exclude-dir matches search dir

Previous Next

Package: grep;

Reported by: Aron Griffis <aron <at> arongriffis.com>

Date: Fri, 10 Jul 2015 03:59:01 UTC

Severity: normal

Merged with 21026

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#21026: closed (--exclude-dir matches search dir)
Date: Mon, 13 Jul 2015 23:36:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 13 Jul 2015 16:35:19 -0700
with message-id <55A44B37.4070506 <at> cs.ucla.edu>
and subject line Re: bug#21027: --exclude-dir matches search dir
has caused the debbugs.gnu.org bug report #21027,
regarding --exclude-dir matches search dir
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
21027: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21027
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Aron Griffis <aron <at> arongriffis.com>
To: bug-grep <at> gnu.org
Subject: --exclude-dir matches search dir
Date: Thu, 9 Jul 2015 22:47:37 -0400
[Message part 3 (text/plain, inline)]
This generates output:

$ grep -rl --exclude-dir=usr LINUX /usr/include

and this doesn't:

$ grep -rl --exclude-dir='usr*' LINUX /usr/include

This feels like a bug. My actual use-case is more like the following, but
the above seems like a more universal test case.

$ grep -rl --exclude-dir='.*' /home/aron/.virtualenvs/pp/src PATT

This surprised me by not generating any results. I had expected the
exclusion to only affect dirs within the given path, not match on the path
itself, but it seems to be aborting because '.*' matches '.virtualenvs'.
Is this a bug or just a bad assumption on my part?

$ grep --version
/usr/bin/grep (GNU grep) 2.21

Thanks,
Aron
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Aron Griffis <aron <at> arongriffis.com>, 21027-done <at> debbugs.gnu.org
Subject: Re: bug#21027: --exclude-dir matches search dir
Date: Mon, 13 Jul 2015 16:35:19 -0700
[Message part 6 (text/plain, inline)]
Aron Griffis wrote:
> This generates output:
>
> $ grep -rl --exclude-dir=usr LINUX /usr/include
>
> and this doesn't:
>
> $ grep -rl --exclude-dir='usr*' LINUX /usr/include
>
> This feels like a bug.

Thanks for reporting that.  I installed the attached patch.

[0001-grep-fix-bug-with-exclude-dir-and-command-line.patch (text/x-diff, attachment)]

This bug report was last modified 10 years and 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.