buggrep - Bugs: bug #29876, --include not working as expected

 
 

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

bug #29876: --include not working as expected

Submitted by:  None
Submitted on:  Thu 13 May 2010 02:28:20 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 14 Aug 2010 08:23:45 PM UTC, comment #2:

Thanks again for the report.
That bug is now fixed via this patch:

http://thread.gmane.org/gmane.comp.gnu.grep.bugs/3127/focus=3160

Jim Meyering <meyering>
Project Administrator
Fri 23 Jul 2010 03:45:28 AM UTC, comment #1:

2.6.3 --include doesn't work as 2.5.4 does.

For instance:

$ mkdir foo
$ cd foo
$ echo 1 > 1
$ echo 2 > 2
$ grep2.5.4 -P --include=[12] "\d" *
1:1
2:2
$ grep2.6.3 -P --include=[12] "\d" *
$

Joe Perches <joeperches>
Thu 13 May 2010 02:28:20 PM UTC, original submission:

The --include option seems completely broken to me. I am using v2.6.3 on Arch Linux.

Example:

# Normal recursive grep works ok...
[alan@perry] ~/test
$ grep -Rl test *
subdir/test.cpp
test.cpp

# test.cpp in the current directory isn't returned
[alan@perry] ~/test
$ grep -Rl --include=\.cpp test
subdir/test.cpp

# I only asked for .h files, why is a .cpp file being returned?
[alan@perry] ~/test
$ grep -Rl --include=\.h test
test.cpp

# Non-recursive, nothing gets returned.
[alan@perry] ~/test
$ grep -l --include=\.cpp test

# Non-recursive, wrong file type returned.
[alan@perry] ~/test
$ grep -l --include=\.h test
test.cpp

I've tried using various combinations of backslashes, single and double quotes on the --include parameter, but to no avail.

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 meyering (Posted a comment)
  • -unavailable- added by bonzini (Updated the item)
  • -unavailable- added by joeperches (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 30 Aug 2010 07:51:20 AM UTCbonziniOpen/ClosedOpen=>Closed
    Sat 14 Aug 2010 08:23:45 PM UTCmeyeringStatusConfirmed=>Fixed
    Sun 25 Jul 2010 10:53:43 AM UTCbonziniStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1