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

Submitted by:  None
Submitted on:  Tue 17 Aug 2010 05:03:47 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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>
Project 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 -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>
Project 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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 02 Mar 2012 05:51:56 PM UTCeggertStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1