From unknown Mon Aug 18 18:00:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63030: Minor innacuracy on --exclude documentation? Resent-From: Sebastian Carlos Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Sun, 23 Apr 2023 11:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63030 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 63030@debbugs.gnu.org X-Debbugs-Original-To: bug-grep@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16822479956000 (code B ref -1); Sun, 23 Apr 2023 11:07:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Apr 2023 11:06:35 +0000 Received: from localhost ([127.0.0.1]:44675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqXYA-0001Yf-PI for submit@debbugs.gnu.org; Sun, 23 Apr 2023 07:06:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:51824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqXY8-0001YX-37 for submit@debbugs.gnu.org; Sun, 23 Apr 2023 07:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqXY6-0002Lk-Ov for bug-grep@gnu.org; Sun, 23 Apr 2023 07:06:31 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqXXx-0005HZ-Ix for bug-grep@gnu.org; Sun, 23 Apr 2023 07:06:29 -0400 Received: by mail-lj1-x243.google.com with SMTP id 38308e7fff4ca-2a8dc09e884so6129701fa.1 for ; Sun, 23 Apr 2023 04:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682247977; x=1684839977; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=CXBXjMdAeIw5mP0SVhsjy/zddw00Dmpi84HO3nJ24Tc=; b=l6T1u+bWL3aFWTZYPoz2xmhMqF3D+6mVe6dsufDgcTA4OuLcg8eeLmpEUzgBd9c9Pq /IvjEgTCnzkG8XuIQETt0T56kZIiI0n4pS4zLENzbEojmzg3Wz20Nm8Vi+7NKAmCX/YV j/5njfvEx6JshsAvwYmTyMj4wGjwtSOxntBZ/oZLYUN1AENmtW8fVEl4sFnLPWEMn6BM h4uNHSzrkSntYwPwGZeMZe4frZdiUgFetYjKNIMtHKukQFBDUzB7Z5YqXIEBjkAFSvYg VAT3xBQr+9MRhL0cQ6sZ+SpvdHRq1/7q7JGGeH00qKxxUe6SdLOLcNAvAT6aPJzm83Bw 7Ceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682247977; x=1684839977; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CXBXjMdAeIw5mP0SVhsjy/zddw00Dmpi84HO3nJ24Tc=; b=ETlU5MnzEzEgauMVG1tQFfexZmWjDREsGnF0bNk1tCIlUQKKi7x4UGZ9wV/i2qbsiL 7tLgyEltYHL1GVnEBXbNdxM7BJHSBDr83NcXRazXQE/JVR5Tno/i5RC4zuRycS1cjyRP kk8off0dCI5TIDC96mXiIXMpGspqlHHc1qFR/mP+rgg93ngLmvTgz+2fnelbQ0vCrt07 S4NFSsscrx/gF9wN6/9BVppQ23Et3kHPKhJylS/GAFiLR2Vm2IG9W8iwCbwoeySwvI8f WnIJxgvbOnLIPkGtnLrNTOv2M8fTU7DWIg4wW7qHBXGaQmcXkzCo8mJko6MyJvLo8gp4 br0Q== X-Gm-Message-State: AAQBX9fxKqCQHQpRDFbe6NyYKccoVXFkLXnNWHCHTVBTnRk+q3e7JDhS +c5rjALZB7hSouA/Q+RLOOrOPSdsSv6Jb3l7EF4F/mk4clUBXQ== X-Google-Smtp-Source: AKy350Yx7XQCLQfJHnDQqNoAvPs+kAtrTY7bSw0kEts7unpcrQ7mayrJmdlF4XrjC7P9GQOJn7uoZDnsPP3J6rfu3PE= X-Received: by 2002:a19:ac46:0:b0:4ef:ed0f:c604 with SMTP id r6-20020a19ac46000000b004efed0fc604mr517512lfc.2.1682247977314; Sun, 23 Apr 2023 04:06:17 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Carlos Date: Sun, 23 Apr 2023 13:06:05 +0200 Message-ID: Content-Type: multipart/alternative; boundary="0000000000001caf4505f9fee19f" Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=sebaaa1754@gmail.com; helo=mail-lj1-x243.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) 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: -2.1 (--) --0000000000001caf4505f9fee19f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, The current version of the --exclude documentation says the following: ``` =E2=80=98--exclude=3DGLOB=E2=80=99 Skip any command-line file with a name suffix that matches the pattern GLOB, using wildcard matching; a name suffix is either the whole name, or a trailing part that starts with a non-slash character immediately after a slash (=E2=80=98/=E2=80=99) in the name.= When searching recursively, skip any subfile whose base name matches GLOB; the base name is the part after the last slash. A pattern can use =E2=80=98*=E2=80=99, =E2=80=98?=E2=80=99, and =E2=80=98[=E2=80= =99...=E2=80=98]=E2=80=99 as wildcards, and =E2=80=98\=E2=80=99 to quote a wildcard or backslash character literally. ``` I think that "Skip any command-line file" should be replaced with "Skip any file", because --exclude does work even if files are not provided as explicit command-line arguments (for example, when using -r). While it could be ambiguous, this interpretation of "command-line file" meaning "files explicitly provided as command-line arguments" is consistent with the documentation for --devices, which makes an explicit distinction between "command-line devices" and "devices that are encountered recursively": ``` =E2=80=98-D ACTION=E2=80=99 =E2=80=98--devices=3DACTION=E2=80=99 If an input file is a device, FIFO, or socket, use ACTION to process it. If ACTION is =E2=80=98read=E2=80=99, all devices are read= just as if they were ordinary files. If ACTION is =E2=80=98skip=E2=80=99, device= s, FIFOs, and sockets are silently skipped. By default, devices are read if they are on the command line or if the =E2=80=98-R=E2=80=99 (=E2=80=98--der= eference-recursive=E2=80=99) option is used, and are skipped if they are encountered recursively and the =E2=80=98-r=E2=80=99 (=E2=80=98--recursive=E2=80=99) option is= used. This option has no effect on a file that is read via standard input. ``` Another significant argument in favor of the proposed change is that the similar --include option doesn't mention "command-line files": ``` =E2=80=98--include=3DGLOB=E2=80=99 Search only files whose name matches GLOB, using wildcard matching as described under =E2=80=98--exclude=E2=80=99. If contradictory =E2= =80=98--include=E2=80=99 and =E2=80=98--exclude=E2=80=99 options are given, the last matching one w= ins. If no =E2=80=98--include=E2=80=99 or =E2=80=98--exclude=E2=80=99 options mat= ch, a file is included unless the first such option is =E2=80=98--include=E2=80=99. ``` --0000000000001caf4505f9fee19f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

The current version of the --exc= lude documentation says the following:

```
=E2=80=98--exclude=3DG= LOB=E2=80=99
=C2=A0 =C2=A0 =C2=A0Skip any command-line file with a name = suffix that matches the
=C2=A0 =C2=A0 =C2=A0pattern GLOB, using wildcard= matching; a name suffix is either the
=C2=A0 =C2=A0 =C2=A0whole name, o= r a trailing part that starts with a non-slash
=C2=A0 =C2=A0 =C2=A0chara= cter immediately after a slash (=E2=80=98/=E2=80=99) in the name.=C2=A0 Whe= n
=C2=A0 =C2=A0 =C2=A0searching recursively, skip any subfile whose base= name matches
=C2=A0 =C2=A0 =C2=A0GLOB; the base name is the part after = the last slash.=C2=A0 A pattern
=C2=A0 =C2=A0 =C2=A0can use =E2=80=98*= =E2=80=99, =E2=80=98?=E2=80=99, and =E2=80=98[=E2=80=99...=E2=80=98]=E2=80= =99 =C2=A0as wildcards, and =E2=80=98\=E2=80=99 to quote a
=C2=A0 =C2=A0= =C2=A0wildcard or backslash character literally.
```

I think tha= t "Skip any command-line file" should be replaced with "Skip= any
file", because --exclude does work even if files are not provi= ded as explicit
command-line arguments (for example, when using -r).
=
While it could be ambiguous, this interpretation of "command-line = file"
meaning "files explicitly provided as command-line argum= ents" is consistent
with the documentation for --devices, which mak= es an explicit distinction
between "command-line devices" and = "devices that are encountered=C2=A0
recursively":
```
=E2=80=98-D ACTION=E2=80=99
=E2=80=98--devices=3DACTION=E2=80= =99
=C2=A0 =C2=A0 =C2=A0If an input file is a device, FIFO, or socket, u= se ACTION to
=C2=A0 =C2=A0 =C2=A0process it.=C2=A0 If ACTION is =E2=80= =98read=E2=80=99, all devices are read just as if
=C2=A0 =C2=A0 =C2=A0th= ey were ordinary files.=C2=A0 If ACTION is =E2=80=98skip=E2=80=99, devices,= FIFOs, and
=C2=A0 =C2=A0 =C2=A0sockets are silently skipped.=C2=A0 By d= efault, devices are read if they
=C2=A0 =C2=A0 =C2=A0are on the command = line or if the =E2=80=98-R=E2=80=99 (=E2=80=98--dereference-recursive=E2=80= =99)
=C2=A0 =C2=A0 =C2=A0option is used, and are skipped if they are enc= ountered recursively
=C2=A0 =C2=A0 =C2=A0and the =E2=80=98-r=E2=80=99 (= =E2=80=98--recursive=E2=80=99) option is used.=C2=A0 This option has no
= =C2=A0 =C2=A0 =C2=A0effect on a file that is read via standard input.
``= `

Another significant argument in favor of the proposed change is th= at the
similar --include option doesn't mention "command-line f= iles":

```
=E2=80=98--include=3DGLOB=E2=80=99
=C2=A0 =C2= =A0 =C2=A0Search only files whose name matches GLOB, using wildcard matchin= g
=C2=A0 =C2=A0 =C2=A0as described under =E2=80=98--exclude=E2=80=99.=C2= =A0 If contradictory =E2=80=98--include=E2=80=99 and
=C2=A0 =C2=A0 =C2= =A0=E2=80=98--exclude=E2=80=99 options are given, the last matching one win= s.=C2=A0 If no
=C2=A0 =C2=A0 =C2=A0=E2=80=98--include=E2=80=99 or =E2=80= =98--exclude=E2=80=99 options match, a file is included unless
=C2=A0 = =C2=A0 =C2=A0the first such option is =E2=80=98--include=E2=80=99.
```
--0000000000001caf4505f9fee19f-- From unknown Mon Aug 18 18:00:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#63030: correction References: In-Reply-To: Resent-From: Sebastian Carlos Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Sun, 23 Apr 2023 12:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63030 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 63030@debbugs.gnu.org Received: via spool by 63030-submit@debbugs.gnu.org id=B63030.168225148922111 (code B ref 63030); Sun, 23 Apr 2023 12:05:01 +0000 Received: (at 63030) by debbugs.gnu.org; 23 Apr 2023 12:04:49 +0000 Received: from localhost ([127.0.0.1]:44710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqYSW-0005kY-Qk for submit@debbugs.gnu.org; Sun, 23 Apr 2023 08:04:48 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:38147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqYSV-0005kL-HS for 63030@debbugs.gnu.org; Sun, 23 Apr 2023 08:04:47 -0400 Received: by mail-lf1-f65.google.com with SMTP id 2adb3069b0e04-4edc51644b6so775108e87.1 for <63030@debbugs.gnu.org>; Sun, 23 Apr 2023 05:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682251481; x=1684843481; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=RHkP81a5vo0NeM+Ras9EnzLOM23ai41OlqjNf/YD+mo=; b=aKMryhaR2pv/cipxlRVDyhHQSqnviLYRj2DgnnEj51DVZjzMucX4WJyQaSg8WUj/Lw yHYqLU/B5mquyrW8m0L1VcUvO5+inkkDwD7hO+tKFh1YfqiEoxGPtnHeO0dCgqwvA+Ao 6CiE5wL/89iZ2TIOkSGZSva0XoEu2rh79KrTNVh1lMyI+myLN/hr7wKNxrq+4ZpYx4bK 1pBRQu1k+k7WZ1d4we2xV12iZfGvXWhtUFzGCyDjcmIqph4fsOslLF3p3g321P4EUOq3 +ZCa0l2i+jYdltHpefzwHEta3VAjsVMYBubjcGZtG4EliGFwzmy50PRRts/0HBLcvOml O2Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682251481; x=1684843481; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=RHkP81a5vo0NeM+Ras9EnzLOM23ai41OlqjNf/YD+mo=; b=Tnv0d5boWKMSC97OU96kbrDKyxiWPBtO5dHp2GJN5UUj/PF7jAW84Uor9rRDnzXkQD Gyhp/8IxZjpQBrPRRvOr+5irYviUSVcMgfJBcXgTkZHgWIOIlMJ5VFmXuaPsILk61VQu TultGgnf8950BMeiKbwkf0/8wHyxgHE+deUPyFrPhiZAYa6/tWaYdqGpb84GPwZNS+pC NwdHaSSP93v98/mZq3r7nDq6Q8E5UKS8qjchKclnJSJ1aRv8BQaf67Evdaxh0eyWxbsD hqG59XrjOsashO7n9JyDRE56UyKk6iaVqCnhNo5AXFuCLB/Hh3D8tecEXXWtNRBJ0wLW UYUg== X-Gm-Message-State: AAQBX9fm+KU9IjKsd8CgA5eAMQhopI5b+4tNpOkJaif8LaENee++58dI bBGEsfR94GTnZO/BQBWgTaJYkGBl1/ob1l11Ah+EnCSUXr1KXQ== X-Google-Smtp-Source: AKy350ZgJY+2FuD5dZIJwUgLWmdQIF6afZgQGI4lWZ0hkemyeHyb8NnEu0V8z4sYUVTsDpeY28gFFsZRzGbCIGLMEM4= X-Received: by 2002:a2e:1f02:0:b0:2a7:653d:1678 with SMTP id f2-20020a2e1f02000000b002a7653d1678mr2396689ljf.1.1682251481062; Sun, 23 Apr 2023 05:04:41 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Carlos Date: Sun, 23 Apr 2023 14:04:29 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000f3a1e705f9ffb166" X-Spam-Score: 0.3 (/) 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.7 (/) --000000000000f3a1e705f9ffb166 Content-Type: text/plain; charset="UTF-8" On second thought, I think the documentation is fine. I just misread it. It has two sentences: "Skip any COMMAND-LINE file with..." and "When searching recursively, skip any SUBFILE whose...". So both cases are considered and it doesn't imply that --exclude acts on command line files only. --000000000000f3a1e705f9ffb166 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On second thought, I think the documentation is fine. I ju= st misread it. It has two sentences: "Skip any COMMAND-LINE file with.= .." and "When searching recursively, skip any SUBFILE whose...&qu= ot;. So both cases are considered and it doesn't imply that --exclude a= cts on command line files only.
--000000000000f3a1e705f9ffb166-- From unknown Mon Aug 18 18:00:28 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Sebastian Carlos Subject: bug#63030: closed (Re: bug#63030: correction) Message-ID: References: X-Gnu-PR-Message: they-closed 63030 X-Gnu-PR-Package: grep Reply-To: 63030@debbugs.gnu.org Date: Mon, 24 Apr 2023 20:06:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1682366762-30982-1" This is a multi-part message in MIME format... ------------=_1682366762-30982-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63030: Minor innacuracy on --exclude documentation? which was filed against the grep package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63030@debbugs.gnu.org. --=20 63030: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63030 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1682366762-30982-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63030-done) by debbugs.gnu.org; 24 Apr 2023 20:06:00 +0000 Received: from localhost ([127.0.0.1]:50392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr2Rk-00083U-Bw for submit@debbugs.gnu.org; Mon, 24 Apr 2023 16:06:00 -0400 Received: from mail-lj1-f175.google.com ([209.85.208.175]:57442) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr2Ri-00083H-My for 63030-done@debbugs.gnu.org; Mon, 24 Apr 2023 16:05:59 -0400 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2a8a600bd05so46175511fa.2 for <63030-done@debbugs.gnu.org>; Mon, 24 Apr 2023 13:05:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682366753; x=1684958753; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EHraKEq3I739gSmtuw/wrxHufmujAEhBymjMj1BBKC0=; b=CoNlKg1X+3gdqQp/3OV2Vp1XvGyyc5uhQgdbtjuG0sVE4OLL6O0PsRiV40QjD0I6SX y2iOe8ar6L4OxHmDLJEllds1vGtVfqVnGntHg27pT68sps6oEhubp97ue4WcbSulZl3h 4um6Mw6dmqMniFQHQV3mbwkJ3w5EKLbyNEPhYvHcyFzNL5u+e9gi4iU1//ZrU99TfWRK U7w7OzFxlEy35VLJV95F6DF4pSFvpt2iSDN+JFyo1T5/o1w1xH95Awkex6mDT7KXOYyN vohHBy3DM5Z1cSrIkEp6Db9Z6CDQunrb+cDbMoC6Uy2UAOdzCi6knMf3VGVwd1VVvtv1 ptvQ== X-Gm-Message-State: AAQBX9dq0f9cpu2ECPHbf8xlovgys22R4IRZZeLtCLE060/6mvHsS7cC JcuvkileioYU/tbcSh3i0A/xAKOkjN5UMKSMW94= X-Google-Smtp-Source: AKy350bceCzqHSl1WOiWDfec0OX65WYg3wugppoTtS0TsC9f5Fjh1VbKY1hx6LoG8JZbcKUdvcQP0Ne6thAjgCgvPxI= X-Received: by 2002:a2e:b2d1:0:b0:2a8:e6f8:301e with SMTP id 17-20020a2eb2d1000000b002a8e6f8301emr2783653ljz.28.1682366752498; Mon, 24 Apr 2023 13:05:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jim Meyering Date: Mon, 24 Apr 2023 13:05:31 -0700 Message-ID: Subject: Re: bug#63030: correction To: Sebastian Carlos Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 63030-done Cc: 63030-done@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.8 (/) tags 63030 notabug done On Sun, Apr 23, 2023 at 5:05=E2=80=AFAM Sebastian Carlos wrote: > On second thought, I think the documentation is fine. I just misread it. = It > has two sentences: "Skip any COMMAND-LINE file with..." and "When searchi= ng > recursively, skip any SUBFILE whose...". So both cases are considered and > it doesn't imply that --exclude acts on command line files only. Thanks for the follow-up. This email closes the issue in our tracker. ------------=_1682366762-30982-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Apr 2023 11:06:35 +0000 Received: from localhost ([127.0.0.1]:44675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqXYA-0001Yf-PI for submit@debbugs.gnu.org; Sun, 23 Apr 2023 07:06:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:51824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqXY8-0001YX-37 for submit@debbugs.gnu.org; Sun, 23 Apr 2023 07:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqXY6-0002Lk-Ov for bug-grep@gnu.org; Sun, 23 Apr 2023 07:06:31 -0400 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqXXx-0005HZ-Ix for bug-grep@gnu.org; Sun, 23 Apr 2023 07:06:29 -0400 Received: by mail-lj1-x243.google.com with SMTP id 38308e7fff4ca-2a8dc09e884so6129701fa.1 for ; Sun, 23 Apr 2023 04:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682247977; x=1684839977; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=CXBXjMdAeIw5mP0SVhsjy/zddw00Dmpi84HO3nJ24Tc=; b=l6T1u+bWL3aFWTZYPoz2xmhMqF3D+6mVe6dsufDgcTA4OuLcg8eeLmpEUzgBd9c9Pq /IvjEgTCnzkG8XuIQETt0T56kZIiI0n4pS4zLENzbEojmzg3Wz20Nm8Vi+7NKAmCX/YV j/5njfvEx6JshsAvwYmTyMj4wGjwtSOxntBZ/oZLYUN1AENmtW8fVEl4sFnLPWEMn6BM h4uNHSzrkSntYwPwGZeMZe4frZdiUgFetYjKNIMtHKukQFBDUzB7Z5YqXIEBjkAFSvYg VAT3xBQr+9MRhL0cQ6sZ+SpvdHRq1/7q7JGGeH00qKxxUe6SdLOLcNAvAT6aPJzm83Bw 7Ceg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682247977; x=1684839977; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CXBXjMdAeIw5mP0SVhsjy/zddw00Dmpi84HO3nJ24Tc=; b=ETlU5MnzEzEgauMVG1tQFfexZmWjDREsGnF0bNk1tCIlUQKKi7x4UGZ9wV/i2qbsiL 7tLgyEltYHL1GVnEBXbNdxM7BJHSBDr83NcXRazXQE/JVR5Tno/i5RC4zuRycS1cjyRP kk8off0dCI5TIDC96mXiIXMpGspqlHHc1qFR/mP+rgg93ngLmvTgz+2fnelbQ0vCrt07 S4NFSsscrx/gF9wN6/9BVppQ23Et3kHPKhJylS/GAFiLR2Vm2IG9W8iwCbwoeySwvI8f WnIJxgvbOnLIPkGtnLrNTOv2M8fTU7DWIg4wW7qHBXGaQmcXkzCo8mJko6MyJvLo8gp4 br0Q== X-Gm-Message-State: AAQBX9fxKqCQHQpRDFbe6NyYKccoVXFkLXnNWHCHTVBTnRk+q3e7JDhS +c5rjALZB7hSouA/Q+RLOOrOPSdsSv6Jb3l7EF4F/mk4clUBXQ== X-Google-Smtp-Source: AKy350Yx7XQCLQfJHnDQqNoAvPs+kAtrTY7bSw0kEts7unpcrQ7mayrJmdlF4XrjC7P9GQOJn7uoZDnsPP3J6rfu3PE= X-Received: by 2002:a19:ac46:0:b0:4ef:ed0f:c604 with SMTP id r6-20020a19ac46000000b004efed0fc604mr517512lfc.2.1682247977314; Sun, 23 Apr 2023 04:06:17 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Carlos Date: Sun, 23 Apr 2023 13:06:05 +0200 Message-ID: Subject: Minor innacuracy on --exclude documentation? To: bug-grep@gnu.org Content-Type: multipart/alternative; boundary="0000000000001caf4505f9fee19f" Received-SPF: pass client-ip=2a00:1450:4864:20::243; envelope-from=sebaaa1754@gmail.com; helo=mail-lj1-x243.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit 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: -2.1 (--) --0000000000001caf4505f9fee19f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, The current version of the --exclude documentation says the following: ``` =E2=80=98--exclude=3DGLOB=E2=80=99 Skip any command-line file with a name suffix that matches the pattern GLOB, using wildcard matching; a name suffix is either the whole name, or a trailing part that starts with a non-slash character immediately after a slash (=E2=80=98/=E2=80=99) in the name.= When searching recursively, skip any subfile whose base name matches GLOB; the base name is the part after the last slash. A pattern can use =E2=80=98*=E2=80=99, =E2=80=98?=E2=80=99, and =E2=80=98[=E2=80= =99...=E2=80=98]=E2=80=99 as wildcards, and =E2=80=98\=E2=80=99 to quote a wildcard or backslash character literally. ``` I think that "Skip any command-line file" should be replaced with "Skip any file", because --exclude does work even if files are not provided as explicit command-line arguments (for example, when using -r). While it could be ambiguous, this interpretation of "command-line file" meaning "files explicitly provided as command-line arguments" is consistent with the documentation for --devices, which makes an explicit distinction between "command-line devices" and "devices that are encountered recursively": ``` =E2=80=98-D ACTION=E2=80=99 =E2=80=98--devices=3DACTION=E2=80=99 If an input file is a device, FIFO, or socket, use ACTION to process it. If ACTION is =E2=80=98read=E2=80=99, all devices are read= just as if they were ordinary files. If ACTION is =E2=80=98skip=E2=80=99, device= s, FIFOs, and sockets are silently skipped. By default, devices are read if they are on the command line or if the =E2=80=98-R=E2=80=99 (=E2=80=98--der= eference-recursive=E2=80=99) option is used, and are skipped if they are encountered recursively and the =E2=80=98-r=E2=80=99 (=E2=80=98--recursive=E2=80=99) option is= used. This option has no effect on a file that is read via standard input. ``` Another significant argument in favor of the proposed change is that the similar --include option doesn't mention "command-line files": ``` =E2=80=98--include=3DGLOB=E2=80=99 Search only files whose name matches GLOB, using wildcard matching as described under =E2=80=98--exclude=E2=80=99. If contradictory =E2= =80=98--include=E2=80=99 and =E2=80=98--exclude=E2=80=99 options are given, the last matching one w= ins. If no =E2=80=98--include=E2=80=99 or =E2=80=98--exclude=E2=80=99 options mat= ch, a file is included unless the first such option is =E2=80=98--include=E2=80=99. ``` --0000000000001caf4505f9fee19f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

The current version of the --exc= lude documentation says the following:

```
=E2=80=98--exclude=3DG= LOB=E2=80=99
=C2=A0 =C2=A0 =C2=A0Skip any command-line file with a name = suffix that matches the
=C2=A0 =C2=A0 =C2=A0pattern GLOB, using wildcard= matching; a name suffix is either the
=C2=A0 =C2=A0 =C2=A0whole name, o= r a trailing part that starts with a non-slash
=C2=A0 =C2=A0 =C2=A0chara= cter immediately after a slash (=E2=80=98/=E2=80=99) in the name.=C2=A0 Whe= n
=C2=A0 =C2=A0 =C2=A0searching recursively, skip any subfile whose base= name matches
=C2=A0 =C2=A0 =C2=A0GLOB; the base name is the part after = the last slash.=C2=A0 A pattern
=C2=A0 =C2=A0 =C2=A0can use =E2=80=98*= =E2=80=99, =E2=80=98?=E2=80=99, and =E2=80=98[=E2=80=99...=E2=80=98]=E2=80= =99 =C2=A0as wildcards, and =E2=80=98\=E2=80=99 to quote a
=C2=A0 =C2=A0= =C2=A0wildcard or backslash character literally.
```

I think tha= t "Skip any command-line file" should be replaced with "Skip= any
file", because --exclude does work even if files are not provi= ded as explicit
command-line arguments (for example, when using -r).
=
While it could be ambiguous, this interpretation of "command-line = file"
meaning "files explicitly provided as command-line argum= ents" is consistent
with the documentation for --devices, which mak= es an explicit distinction
between "command-line devices" and = "devices that are encountered=C2=A0
recursively":
```
=E2=80=98-D ACTION=E2=80=99
=E2=80=98--devices=3DACTION=E2=80= =99
=C2=A0 =C2=A0 =C2=A0If an input file is a device, FIFO, or socket, u= se ACTION to
=C2=A0 =C2=A0 =C2=A0process it.=C2=A0 If ACTION is =E2=80= =98read=E2=80=99, all devices are read just as if
=C2=A0 =C2=A0 =C2=A0th= ey were ordinary files.=C2=A0 If ACTION is =E2=80=98skip=E2=80=99, devices,= FIFOs, and
=C2=A0 =C2=A0 =C2=A0sockets are silently skipped.=C2=A0 By d= efault, devices are read if they
=C2=A0 =C2=A0 =C2=A0are on the command = line or if the =E2=80=98-R=E2=80=99 (=E2=80=98--dereference-recursive=E2=80= =99)
=C2=A0 =C2=A0 =C2=A0option is used, and are skipped if they are enc= ountered recursively
=C2=A0 =C2=A0 =C2=A0and the =E2=80=98-r=E2=80=99 (= =E2=80=98--recursive=E2=80=99) option is used.=C2=A0 This option has no
= =C2=A0 =C2=A0 =C2=A0effect on a file that is read via standard input.
``= `

Another significant argument in favor of the proposed change is th= at the
similar --include option doesn't mention "command-line f= iles":

```
=E2=80=98--include=3DGLOB=E2=80=99
=C2=A0 =C2= =A0 =C2=A0Search only files whose name matches GLOB, using wildcard matchin= g
=C2=A0 =C2=A0 =C2=A0as described under =E2=80=98--exclude=E2=80=99.=C2= =A0 If contradictory =E2=80=98--include=E2=80=99 and
=C2=A0 =C2=A0 =C2= =A0=E2=80=98--exclude=E2=80=99 options are given, the last matching one win= s.=C2=A0 If no
=C2=A0 =C2=A0 =C2=A0=E2=80=98--include=E2=80=99 or =E2=80= =98--exclude=E2=80=99 options match, a file is included unless
=C2=A0 = =C2=A0 =C2=A0the first such option is =E2=80=98--include=E2=80=99.
```
--0000000000001caf4505f9fee19f-- ------------=_1682366762-30982-1--