From unknown Tue Aug 19 12:50:49 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#33699 <33699@debbugs.gnu.org> To: bug#33699 <33699@debbugs.gnu.org> Subject: Status: Multi-component paths ignored by --{exclude,include}-dir ? Reply-To: bug#33699 <33699@debbugs.gnu.org> Date: Tue, 19 Aug 2025 19:50:49 +0000 retitle 33699 Multi-component paths ignored by --{exclude,include}-dir ? reassign 33699 grep submitter 33699 Lyude Paul severity 33699 normal tag 33699 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 10 19:18:28 2018 Received: (at submit) by debbugs.gnu.org; 11 Dec 2018 00:18:28 +0000 Received: from localhost ([127.0.0.1]:42314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWVko-0006EM-5l for submit@debbugs.gnu.org; Mon, 10 Dec 2018 19:18:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWVI2-0003S1-Qy for submit@debbugs.gnu.org; Mon, 10 Dec 2018 18:48:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWVHt-0004Ul-IL for submit@debbugs.gnu.org; Mon, 10 Dec 2018 18:48:35 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gWVHs-0004Ty-CT for submit@debbugs.gnu.org; Mon, 10 Dec 2018 18:48:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWVHr-0007TR-Fq for bug-grep@gnu.org; Mon, 10 Dec 2018 18:48:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWVHm-0004PP-FT for bug-grep@gnu.org; Mon, 10 Dec 2018 18:48:31 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:46644) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWVHl-0004OS-Ut for bug-grep@gnu.org; Mon, 10 Dec 2018 18:48:26 -0500 Received: by mail-qk1-f182.google.com with SMTP id q1so7582008qkf.13 for ; Mon, 10 Dec 2018 15:48:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:organization :user-agent:mime-version:content-transfer-encoding; bh=B/OUejcx1wzjVnGufkyTPB8l4xqBylMfR6d5veUOW+E=; b=Abs5h7UBKDOqvbBfn3YbEC7Danr42NAhEv9r2PT4zIO1ZouughIyDRuLTaAvqPNQKZ 801AAH7kM/67IKU6VTEThiP+VjZz4NTYmXFbixXz63upgAw3bobbVLCikWKN3s3nnlFg 4C+HKZtGDTN77OBUQWCTXW5TjFO8qlRkesaKtlHwcpdMiWQs1L9x/UhNolhJtQk2p/Hj N15XOE/MeWI1CqdLCymiosOE90PKmSoIZxNjSV7FGzMX0quW1XknzvSQDs32hsiQVwj3 c0SzEBM9DEbZgkAfPSzV7MPQ0tgRj96s2vF/IZu3U/g0ANVxMyl7WOZZyJoueSqKZWEO HI2A== X-Gm-Message-State: AA+aEWbksnyJgcvA2cq2kykweWljDvik0aOU4oADeFp3xP2nG8E0G+pu cqnA2k3jGn5G9XJZk1lT0UjPSQd2oOo= X-Google-Smtp-Source: AFSGD/Vdr2+h/X8Yxx5yFWDtw7BztcPkAozZR6XbL3jVdsv/0RHZD9JtHA6tuHdO8Sm21w70+tb+Qw== X-Received: by 2002:a37:4289:: with SMTP id p131mr12755871qka.3.1544485704539; Mon, 10 Dec 2018 15:48:24 -0800 (PST) Received: from dhcp-10-20-1-11.bss.redhat.com ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id k132sm6978558qke.36.2018.12.10.15.48.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 15:48:24 -0800 (PST) Message-ID: <1e8648cafab0fbcde8160bf52b7b61e69a931239.camel@redhat.com> Subject: Multi-component paths ignored by --{exclude,include}-dir ? From: Lyude Paul To: bug-grep@gnu.org Date: Mon, 10 Dec 2018 18:48:22 -0500 Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 10 Dec 2018 19:18:24 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -5.1 (-----) Hi! Sorry for bugging you, but I noticed something a little peculiar about grep that I wasn't expecting, and I'm not sure if this is a bug or not. I've been trying to use grep in one of my scripts to exclude files from any directories starting with Documentation/output using --exclude-dir. Example: grep vcpi_ . -rl --exclude-dir Documentation/output However, this doesn't seem to work at all as it returns: ./Module.symvers ./drivers/gpu/drm/radeon/radeon_dp_mst.c ./drivers/gpu/drm/drm_dp_mst_topology.c ./drivers/gpu/drm/nouveau/dispnv50/disp.c ./drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c ./drivers/gpu/drm/nouveau/include/nvif/cl5070.h ./drivers/gpu/drm/Module.symvers ./drivers/gpu/drm/i915/intel_dp_mst.c ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c ./include/drm/drm_dp_mst_helper.h ./Documentation/output/gpu/drm-kms-helpers.html ./Documentation/output/gpu/drm-dp-mst-helpers.html ./Documentation/output/gpu/dp-mst.html ./Documentation/output/genindex.html ./Documentation/output/latex/gpu.aux ./Documentation/output/latex/gpu.tex ./Documentation/output/searchindex.js I would have thought maybe this could be worked around by using --exclude instead: grep vcpi_ . -rl --exclude '.*Documentation/output.*' But the result is the same. Is this intentional, or an actual bug? Either way, at the very least it seems like something that should be clarified in the man page. -- Cheers, Lyude Paul From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 10 20:15:11 2018 Received: (at submit) by debbugs.gnu.org; 11 Dec 2018 01:15:11 +0000 Received: from localhost ([127.0.0.1]:42495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWWdi-0001R5-4I for submit@debbugs.gnu.org; Mon, 10 Dec 2018 20:15:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWVKa-0003WR-NN for submit@debbugs.gnu.org; Mon, 10 Dec 2018 18:51:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWVKU-0005ya-RB for submit@debbugs.gnu.org; Mon, 10 Dec 2018 18:51:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gWVKU-0005yU-OE for submit@debbugs.gnu.org; Mon, 10 Dec 2018 18:51:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWVKT-0007fv-VI for bug-grep@gnu.org; Mon, 10 Dec 2018 18:51:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWVKO-0005vX-VZ for bug-grep@gnu.org; Mon, 10 Dec 2018 18:51:13 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWVKO-0005v6-QK for bug-grep@gnu.org; Mon, 10 Dec 2018 18:51:08 -0500 Received: by mail-qt1-f195.google.com with SMTP id n21so14486157qtl.6 for ; Mon, 10 Dec 2018 15:51:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:organization:user-agent:mime-version :content-transfer-encoding; bh=XPId/umEWvhqIfpI9kL3U0RQ2pS+hKzmCgw9AKeN7Rw=; b=NaviSYdv1IlfpHlax4qv+JqE3UgdM+OqxiXndjWiDUlD5vZWPelcVtcJ5zhGXg0MrT ZQSyFsTjearXnny9cKGCkJOM8okp1schTU35GS8lEBAscjMG+bWDV1fAf87jYOjPjNp9 ZdmjI3JnH2bpMDUjFoYX4NHuM2bUvi7OoqCZpdf8ZzdxqG+unrZ/bzDjNEObDidVRGq1 vAormEhdJ/d4IAfIGrtUqMYnyk+cKF8HzgxQiJn83ts/jefyKtEHvCQuxvfu5z4RaI4m Fn2o/QbhLoWsu7XMvY8kHvGtwROFS8IhyBSOH5EiX2fTEz7p+jIXG3zlBEmEyR2DVXug OLww== X-Gm-Message-State: AA+aEWZRIxWBoVvtl3mFN8qj34NnM5gocwCYVtfW0Yp0gsdt+p8GDLVF ZU4VLuOuNuasqkk9uLlo0kp5vuoIBjM= X-Google-Smtp-Source: AFSGD/XI6Eo2Vytd4VJ+6EmPANxJc4Brow33g/sXzUB7BtmBBnq6FUIGjSpLfXTD4hC0NMBC51I0Fg== X-Received: by 2002:ac8:65c7:: with SMTP id t7mr13855779qto.143.1544485867912; Mon, 10 Dec 2018 15:51:07 -0800 (PST) Received: from dhcp-10-20-1-11.bss.redhat.com ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id j38sm10404131qtj.72.2018.12.10.15.51.07 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 15:51:07 -0800 (PST) Message-ID: <59ad8d65b1e0367d168274bf1a8fd033d80c68a3.camel@redhat.com> Subject: Re: Multi-component paths ignored by --{exclude,include}-dir ? From: Lyude Paul To: bug-grep@gnu.org Date: Mon, 10 Dec 2018 18:51:06 -0500 In-Reply-To: <1e8648cafab0fbcde8160bf52b7b61e69a931239.camel@redhat.com> References: <1e8648cafab0fbcde8160bf52b7b61e69a931239.camel@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 10 Dec 2018 20:15:09 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -5.1 (-----) Oh whoops, almost forgot to mention the version of grep I'm using: grep-3.1-8.fc29 on Fedora 29 I've also checked through the source files for Fedora's grep package, and confirmed there's no patches getting applied that would modify the behavior of --exclude and friends. On Mon, 2018-12-10 at 18:48 -0500, Lyude Paul wrote: > Hi! Sorry for bugging you, but I noticed something a little peculiar about > grep that I wasn't expecting, and I'm not sure if this is a bug or not. > I've been trying to use grep in one of my scripts to exclude files from > any directories starting with Documentation/output using --exclude-dir. > Example: > > grep vcpi_ . -rl --exclude-dir Documentation/output > > However, this doesn't seem to work at all as it returns: > > ./Module.symvers > ./drivers/gpu/drm/radeon/radeon_dp_mst.c > ./drivers/gpu/drm/drm_dp_mst_topology.c > ./drivers/gpu/drm/nouveau/dispnv50/disp.c > ./drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c > ./drivers/gpu/drm/nouveau/include/nvif/cl5070.h > ./drivers/gpu/drm/Module.symvers > ./drivers/gpu/drm/i915/intel_dp_mst.c > ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c > ./include/drm/drm_dp_mst_helper.h > ./Documentation/output/gpu/drm-kms-helpers.html > ./Documentation/output/gpu/drm-dp-mst-helpers.html > ./Documentation/output/gpu/dp-mst.html > ./Documentation/output/genindex.html > ./Documentation/output/latex/gpu.aux > ./Documentation/output/latex/gpu.tex > ./Documentation/output/searchindex.js > > I would have thought maybe this could be worked around by using > --exclude instead: > > grep vcpi_ . -rl --exclude '.*Documentation/output.*' > > But the result is the same. Is this intentional, or an actual bug? > Either way, at the very least it seems like something that should be > clarified in the man page. -- Cheers, Lyude Paul From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 10 20:15:11 2018 Received: (at 33699) by debbugs.gnu.org; 11 Dec 2018 01:15:11 +0000 Received: from localhost ([127.0.0.1]:42499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWWdj-0001RL-0s for submit@debbugs.gnu.org; Mon, 10 Dec 2018 20:15:11 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:40411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWVsL-0006Ru-W1 for 33699@debbugs.gnu.org; Mon, 10 Dec 2018 19:26:14 -0500 Received: by mail-qt1-f169.google.com with SMTP id k12so14548277qtf.7 for <33699@debbugs.gnu.org>; Mon, 10 Dec 2018 16:26:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:organization :user-agent:mime-version:content-transfer-encoding; bh=6WmlVgNXoCWpE9oBwKNLsjZ+ry4HXjuC1ulPLJ1AlNA=; b=ll7uwUcg51ttb4rjOyyuf8jK+yYltU6FLygMDb+2BG4OuFygU/kaaWoD2YM8B1KXQv qzJgUbtMdj4LZhDGjsirza2A4+9EaooZvZTOm+rmMthSquV2BSWbYU6uQhQFhsOxinmp vrOeHhOJwyTuGzG6oD/XUbnK6TRNIWZVC5g8yWc7+R+bd5TGhKYfDfuNIRkiP8ZXcbYz ciC5tfv8326PmSYHdktaKBareLcewYiu6GkVWKW8K/9YldP7feE8JH8DlIlwVcYjdAQL i5KlxjYJaXmOlbE6iyywwRpZSwRwM/Gks+pMIE/+fpUtR1RwMLP23R+fRbKvMfMROjN8 H3YQ== X-Gm-Message-State: AA+aEWYOO9nQuvC3CXR7yFmS3lAyF9jM2o4Kgyp9X8bAakH9tiQZlOrM 0KtLKFKK39G5Wdeej5mj7Ona0nYAEbc= X-Google-Smtp-Source: AFSGD/WNTVt8oSgNMkrHd6wlJ2V5TCBhjAvuIn4zjJzwyPK7xF6gGbiSg8WFwYtAk4jgR6oacxqvog== X-Received: by 2002:ac8:32dc:: with SMTP id a28mr14457527qtb.41.1544487968188; Mon, 10 Dec 2018 16:26:08 -0800 (PST) Received: from dhcp-10-20-1-11.bss.redhat.com ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id q38sm8332127qtj.65.2018.12.10.16.26.07 for <33699@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Dec 2018 16:26:07 -0800 (PST) Message-ID: Subject: More info From: Lyude Paul To: 33699@debbugs.gnu.org Date: Mon, 10 Dec 2018 19:26:06 -0500 Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33699 X-Mailman-Approved-At: Mon, 10 Dec 2018 20:15:09 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Just sending this here again, since I realized that my original response to my own message that was sent to bug-grep@gnu.org probably did not get carried over into the bug tracker (if it did, apologies for the extra noise): > Oh whoops, almost forgot to mention the version of grep I'm using: > > grep-3.1-8.fc29 on Fedora 29 > > I've also checked through the source files for Fedora's grep package, and > confirmed there's no patches getting applied that would modify the behavior > of > --exclude and friends. -- Cheers, Lyude Paul From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 15 14:13:09 2018 Received: (at 33699) by debbugs.gnu.org; 15 Dec 2018 19:13:09 +0000 Received: from localhost ([127.0.0.1]:49644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYFN7-0007ht-IA for submit@debbugs.gnu.org; Sat, 15 Dec 2018 14:13:09 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:39926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYFN5-0007hY-7f for 33699@debbugs.gnu.org; Sat, 15 Dec 2018 14:13:07 -0500 Received: by mail-wm1-f49.google.com with SMTP id f81so8813055wmd.4 for <33699@debbugs.gnu.org>; Sat, 15 Dec 2018 11:13:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WK1mRDxARVZ4O8FscfdEDzaJ/20WkPJyRipZ+Ie9wng=; b=Z92DOkwK59VC6RGBSxjNgST9MBp11dncIFPNAFJb4xr/s3Gq62h2JuStldhNfni4SI gltY24r4cL19+Pd8dNryPTWUXCvrRF302BwicJOKqmSvLJjXipy5hwjWOzjrn5ZaLoYO T9aPxfGRnaVcUQYIPQ8CXQQTZwgBrj5UqNN/g4dIS55bZol2ocndHTBwQb1RnllOYSVv tsGQ48/EKeLa+i9qYpFzkOxDAa6MKOQWaKpMOiDKd2hl5CEgqOpvYKLbKJoBBZN4Zq+y 3oCY8+VK8ajt2H/a/e1zSj3No+9LxD9oc/UqxilnWFR6V9PMjMtdP+HRL2MlTwj8/z2m JJQw== X-Gm-Message-State: AA+aEWZS7OKkO2CiEVc6LmOE2mCwgoqoyl/eyvKzVPDHnudTsiqyVNet bhTgwDXbzDDELclm6jaSia8970tK8+68Dgs8zIA= X-Google-Smtp-Source: AFSGD/WZQ/1mVCZfJYDLZkii4GuZWTdMZURMZnUDxeJ+ajttDnj4ggCOKTvdBSot0rJ1pPZfZ/b536hlnlcBPtg6fhE= X-Received: by 2002:a1c:6a09:: with SMTP id f9mr7190274wmc.150.1544901181366; Sat, 15 Dec 2018 11:13:01 -0800 (PST) MIME-Version: 1.0 References: <1e8648cafab0fbcde8160bf52b7b61e69a931239.camel@redhat.com> <59ad8d65b1e0367d168274bf1a8fd033d80c68a3.camel@redhat.com> In-Reply-To: <59ad8d65b1e0367d168274bf1a8fd033d80c68a3.camel@redhat.com> From: Jim Meyering Date: Sat, 15 Dec 2018 11:12:48 -0800 Message-ID: Subject: Re: bug#33699: Multi-component paths ignored by --{exclude, include}-dir ? To: lyude@redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 33699 Cc: 33699@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.9 (/) tags 33699 notabug close 33699 stop On Mon, Dec 10, 2018 at 5:29 PM Lyude Paul wrote: > Oh whoops, almost forgot to mention the version of grep I'm using: > grep-3.1-8.fc29 on Fedora 29 > > I've also checked through the source files for Fedora's grep package, and > confirmed there's no patches getting applied that would modify the behavior of > --exclude and friends. > > On Mon, 2018-12-10 at 18:48 -0500, Lyude Paul wrote: > > Hi! Sorry for bugging you, but I noticed something a little peculiar about > > grep that I wasn't expecting, and I'm not sure if this is a bug or not. > > I've been trying to use grep in one of my scripts to exclude files from > > any directories starting with Documentation/output using --exclude-dir. > > Example: > > > > grep vcpi_ . -rl --exclude-dir Documentation/output > > > > However, this doesn't seem to work at all as it returns: > > > > ./Module.symvers > > ./drivers/gpu/drm/radeon/radeon_dp_mst.c > > ./drivers/gpu/drm/drm_dp_mst_topology.c > > ./drivers/gpu/drm/nouveau/dispnv50/disp.c > > ./drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c > > ./drivers/gpu/drm/nouveau/include/nvif/cl5070.h > > ./drivers/gpu/drm/Module.symvers > > ./drivers/gpu/drm/i915/intel_dp_mst.c > > ./drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c > > ./include/drm/drm_dp_mst_helper.h > > ./Documentation/output/gpu/drm-kms-helpers.html > > ./Documentation/output/gpu/drm-dp-mst-helpers.html > > ./Documentation/output/gpu/dp-mst.html > > ./Documentation/output/genindex.html > > ./Documentation/output/latex/gpu.aux > > ./Documentation/output/latex/gpu.tex > > ./Documentation/output/searchindex.js Thanks for the report. However you are searching recursively, so when the manual says this: --exclude-dir=GLOB ... When searching recursively, skip any subdirectory whose base name matches GLOB. Ignore any redundant trailing slashes in GLOB. it means that a nontrivial GLOB containing a slash will never match, since the only base name that can contain a slash is the degenerate one: "/". > > I would have thought maybe this could be worked around by using > > --exclude instead: > > > > grep vcpi_ . -rl --exclude '.*Documentation/output.*' You've specified what looks like regular expression, with ".*" at front and back. this option takes a GLOB, not a regular expression. And as above, when recursive, the GLOB cannot usefully contain a slash. As such, I'm closing this as not-a-bug. From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 02 03:57:04 2020 Received: (at control) by debbugs.gnu.org; 2 Jan 2020 08:57:04 +0000 Received: from localhost ([127.0.0.1]:38079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imwHv-00039Q-WC for submit@debbugs.gnu.org; Thu, 02 Jan 2020 03:57:04 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44530) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imwHu-00038Z-4d for control@debbugs.gnu.org; Thu, 02 Jan 2020 03:57:02 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id B6689160017 for ; Thu, 2 Jan 2020 00:56:56 -0800 (PST) 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 yybRu1DncCoQ for ; Thu, 2 Jan 2020 00:56:56 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2A591160054 for ; Thu, 2 Jan 2020 00:56:56 -0800 (PST) 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 7D7PgcH2ZH0Q for ; Thu, 2 Jan 2020 00:56:56 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 085F4160017 for ; Thu, 2 Jan 2020 00:56:56 -0800 (PST) To: control@debbugs.gnu.org From: Paul Eggert Subject: 33699 is not a bug Organization: UCLA Computer Science Department Message-ID: Date: Thu, 2 Jan 2020 00:56:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -3.3 (---) tags 33699 notabug close 33699 stop From unknown Tue Aug 19 12:50:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 30 Jan 2020 12:24:10 +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