buggrep - Bugs: bug #36324, grep version 2.12 --include...

 
 

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

bug #36324: grep version 2.12 --include --exclude STILL BROKEN since 2.5.6 or so...

Submitted by:  Quentin Arce <qarce>
Submitted on:  Fri 27 Apr 2012 09:26:12 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Paul Eggert <eggert>
Open/Closed:  Closed

Sun 06 May 2012 10:55:07 PM UTC, comment #3: 

I've patched the GNU grep git master branch and am closing this bug report.  Thanks again for reporting it.

Thank you for the bug report. This bug has been fixed in the
development sources, which can be downloaded using git from
git://git.sv.gnu.org/grep.git

Paul Eggert <eggert>
Project MemberIn charge of this item.
Mon 30 Apr 2012 02:51:59 AM UTC, comment #2: 

Thanks for the bug report. I am attaching a proposed patch. It assumes that the 'grep' source code has synced to the latest gnulib.

(file #25759)

Paul Eggert <eggert>
Project MemberIn charge of this item.
Sun 29 Apr 2012 02:00:15 PM UTC, comment #1: 

As it is currently implemented, --include and --exclude do work correctly, but they only apply to recursively-searched directories:

yakj:~/devel/grep/+build/src/ff pbonzini$ ../grep -R : .
./a::
./b::
yakj:~/devel/grep/+build/src/ff pbonzini$ ../grep -R --include=a : .
./a::
yakj:~/devel/grep/+build/src/ff pbonzini$ ../grep -R --exclude=a : .
./b::
yakj:~/devel/grep/+build/src/ff pbonzini$ ../grep -R --exclude=*a : .
./b::
yakj:~/devel/grep/+build/src/ff pbonzini$ ../grep -R --include=*a : .
./a::
yakj:~/devel/grep/+build/src/ff pbonzini$ ../grep -R --include=*b : .
./b::

I'll try tomorrow whether older versions had a different behevior.

Paolo Bonzini <bonzini>
Fri 27 Apr 2012 09:26:12 PM UTC, original submission:  

Given a directory containing some C files

foo.c
bar.c
dog.c

The following used to work to show the defines in bar.c and dog.c

grep --include="*.c" --exclude="foo.c" define *

Now... the --include="*.c" acts as if it is --exclude and you get NOTHING!!!!

Here is a quick test based on your test script to show what I am talking about.

qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ echo : >> a
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ echo : >> b
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ grep  :  *
a::
b::
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ grep  --include=a :  *
b::
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ grep  --exclude=a :  *
b::
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ grep  --exclude=*a :  *
b::
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ grep  --include=*a :  *
b::
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$ grep  --include=*b :  *
a::
qarce@linux:~/grep-2.12/tests/gt-include-exclude.dQeg/x$

Quentin Arce <qarce>

 

Attached Files
file #25759:  exclude-patch.txt added by eggert (6KiB - text/plain - fix for the bug (assumes latest gnulib))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eggert (Updated the item)
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by qarce (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-06 eggert StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2012-04-30 eggert Attached File- => Added exclude-patch.txt, #25759
        StatusNone => Ready For Test
        Assigned toNone => eggert

    Back to the top


    Powered by Savane 3.5