buggrep - Bugs: bug #30792, --ignore-dir should not override...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #30792: --ignore-dir should not override files passed on the command line

Submitter:  None
Submitted:  Tue 17 Aug 2010 05:03:47 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Fri 02 Mar 2012 05:51:56 PM UTC, comment #3: 

The patch has been applied to the grep master so I'm marking this bug as fixed.

Paul Eggert <eggert>
Group Member
Sat 24 Dec 2011 10:36:08 AM UTC, comment #2: 

It's definitely a bug.  I discovered the bug independently and submitted a patch to -email is unavailable- just now -- I was about to file a bug report and discovered your bug.  The patch is in
<http://lists.gnu.org/archive/html/bug-grep/2011-12/msg00035.html>.

Paul Eggert <eggert>
Group Member
Wed 18 Aug 2010 02:41:33 AM UTC, comment #1: 

I submitted this bug.  First of all, my mistake.  It is --exclude-dir.

Upon looking through the mailing list, I now see this message: <http://lists.gnu.org/archive/html/bug-grep/2010-08/msg00003.html> and it seems that this behavior may be a deliberate design decision and not just a bug or oversight.  Is that the case?

I'm trying to set up a convenience alias for grep which ignores all dot files/dirs.  However, I'm not having much luck.  The approach I described in the ticket (excluding '.*') doesn't work because '.' gets matched.  So how about '.?*' ?  Well, this mysteriously only searches items directly in the current directory, without recursing.  '.??*' gives the same result.  I don't understand this at all.

Excluding '.[0-9a-zA-Z]*' mostly works, but to make it truly universal I'd need to add every conceivable character in there and that is not realistic.

Another approach is to use `pwd` instead of '.' as the argument, which side-steps the problem; but this results in the output having all absolute filenames, which is pretty unusable.

Is there any good way to do this?

Nick Welch <mackstann>
Tue 17 Aug 2010 05:03:47 AM UTC, original submission:  

The following command is bafflingly a no-op:

grep -r --ignore-dir='.*' foo .

It took me a while to realize what was going on, partially because the man page is confusing about whether --ignore-dir accepts a glob, or a regex, or neither.

The problem is that the --ignore-dir option is overriding the fact that I explicitly told grep to search ".".  I think any files/dirs explicitly passed on the command line should override any ignore options.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eggert (Posted a comment)
  • -email is unavailable- added by mackstann (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-03-02 eggert StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code