From unknown Thu Aug 14 18:39:45 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#21026 <21026@debbugs.gnu.org> To: bug#21026 <21026@debbugs.gnu.org> Subject: Status: --exclude-dir matches search dir Reply-To: bug#21026 <21026@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:39:45 +0000 retitle 21026 --exclude-dir matches search dir reassign 21026 grep submitter 21026 Aron Griffis severity 21026 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 09 22:52:38 2015 Received: (at submit) by debbugs.gnu.org; 10 Jul 2015 02:52:38 +0000 Received: from localhost ([127.0.0.1]:45699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDOQX-0005Cw-Bq for submit@debbugs.gnu.org; Thu, 09 Jul 2015 22:52:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53231) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDOMB-00056M-Hj for submit@debbugs.gnu.org; Thu, 09 Jul 2015 22:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDOM5-0005ii-3h for submit@debbugs.gnu.org; Thu, 09 Jul 2015 22:48:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDOM5-0005ie-0Z for submit@debbugs.gnu.org; Thu, 09 Jul 2015 22:48:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDOM3-0008Gy-Ss for bug-grep@gnu.org; Thu, 09 Jul 2015 22:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDOM3-0005iF-0b for bug-grep@gnu.org; Thu, 09 Jul 2015 22:47:59 -0400 Received: from mail-ob0-x230.google.com ([2607:f8b0:4003:c01::230]:35822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDOM2-0005i5-Qy for bug-grep@gnu.org; Thu, 09 Jul 2015 22:47:58 -0400 Received: by obbop1 with SMTP id op1so183540429obb.2 for ; Thu, 09 Jul 2015 19:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=9tK/OKs1lLDTCRtifr7iFsgQrpsaaEBy/NgnsZ51iDE=; b=z40Od+V+++qNSspn1dPoAJ7p7OXp2oNQvqSM0VZLKkVSCCtXTaMfrHtbj5BAJcm+Nv vHDxUHmnyXIMBMDuyvsdH9aRe92m1tkvjBDSmbGmeabZceGu8y72ZpWWRY6YDHq1MIC/ J/12RENJ5jPnDbYcDj3w2O3K/VjkozEPAWcHU5pog1e2Kw3qDh/9z4x0tOuuNwxx/toP zfZrVgsb1mzzkU1FrOKN9QF7UPmj0m8Oyps2sWNyDrobxF5eMm8LGUgFKHtj51eBvRjW 6X6IQ1fykzlxFfAYQk66MpEaCv04KWb1ZVReaZZ/Bd3xzOqCUXDRdGHHNe9oDToeJeKq FvHA== X-Received: by 10.202.61.70 with SMTP id k67mr1797840oia.88.1436496477242; Thu, 09 Jul 2015 19:47:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.37.134 with HTTP; Thu, 9 Jul 2015 19:47:37 -0700 (PDT) From: Aron Griffis Date: Thu, 9 Jul 2015 22:47:37 -0400 X-Google-Sender-Auth: uSwMLHyrkuq2A8dbc63Ov2yTuWA Message-ID: Subject: --exclude-dir matches search dir To: bug-grep@gnu.org Content-Type: multipart/alternative; boundary=001a113cd5223f4ed2051a7c66fe X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 09 Jul 2015 22:52:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a113cd5223f4ed2051a7c66fe Content-Type: text/plain; charset=UTF-8 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 --001a113cd5223f4ed2051a7c66fe Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This generates output:

$ grep -rl --exc= lude-dir=3Dusr LINUX /usr/include

and this does= n't:

$ grep -rl --exclude-dir=3D&#= 39;usr*' LINUX /usr/include

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

$ grep -rl --exc= lude-dir=3D'.*' /home/aron/.virtualenvs/pp/src PATT

<= /div>
This surprised me by not generating any results. I had expected t= he exclusion to only affect dirs within the given path, not match on the pa= th itself, but it seems to be aborting because '.*' matches '.v= irtualenvs'.=C2=A0 Is this a bug or just a bad assumption on my part?

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

Thanks,
Aron
--001a113cd5223f4ed2051a7c66fe-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 11 08:30:55 2015 Received: (at control) by debbugs.gnu.org; 11 Jul 2015 12:30:55 +0000 Received: from localhost ([127.0.0.1]:46676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDtvj-0001w5-DV for submit@debbugs.gnu.org; Sat, 11 Jul 2015 08:30:55 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60958) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZDtvh-0001vr-UI for control@debbugs.gnu.org; Sat, 11 Jul 2015 08:30:54 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 297D21608FB for ; Sat, 11 Jul 2015 05:30:48 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id KuGExVUo_ZNa for ; Sat, 11 Jul 2015 05:30:47 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 80BE6160924 for ; Sat, 11 Jul 2015 05:30:47 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YtB-T836LGGy for ; Sat, 11 Jul 2015 05:30:47 -0700 (PDT) Received: from [192.168.0.11] (cpe-69-76-13-118.natnow.res.rr.com [69.76.13.118]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4CA7C1608FB for ; Sat, 11 Jul 2015 05:30:47 -0700 (PDT) Message-ID: <55A10C75.7070904@cs.ucla.edu> Date: Sat, 11 Jul 2015 05:30:45 -0700 From: Paul Eggert User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: merge 21026 21027 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) merge 21026 21027 thanks From unknown Thu Aug 14 18:39:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 15 Aug 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator