GNU bug report logs - #63030
Minor innacuracy on --exclude documentation?

Previous Next

Package: grep;

Reported by: Sebastian Carlos <sebaaa1754 <at> gmail.com>

Date: Sun, 23 Apr 2023 11:07:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Meyering <jim <at> meyering.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#63030: closed (Minor innacuracy on --exclude documentation?)
Date: Mon, 24 Apr 2023 20:06:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 24 Apr 2023 13:05:31 -0700
with message-id <CA+8g5KGynNwG+yfy1T=Ma4APUT2JSpjRqfSUvqw_Sswqdd=H4Q <at> mail.gmail.com>
and subject line Re: bug#63030: correction
has caused the debbugs.gnu.org bug report #63030,
regarding Minor innacuracy on --exclude documentation?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
63030: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63030
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Sebastian Carlos <sebaaa1754 <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: Minor innacuracy on --exclude documentation?
Date: Sun, 23 Apr 2023 13:06:05 +0200
[Message part 3 (text/plain, inline)]
Hello,

The current version of the --exclude documentation says the following:

```
‘--exclude=GLOB’
     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 (‘/’) 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 ‘*’, ‘?’, and ‘[’...‘]’  as wildcards, and ‘\’ 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":

```
‘-D ACTION’
‘--devices=ACTION’
     If an input file is a device, FIFO, or socket, use ACTION to
     process it.  If ACTION is ‘read’, all devices are read just as if
     they were ordinary files.  If ACTION is ‘skip’, devices, FIFOs, and
     sockets are silently skipped.  By default, devices are read if they
     are on the command line or if the ‘-R’ (‘--dereference-recursive’)
     option is used, and are skipped if they are encountered recursively
     and the ‘-r’ (‘--recursive’) 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":

```
‘--include=GLOB’
     Search only files whose name matches GLOB, using wildcard matching
     as described under ‘--exclude’.  If contradictory ‘--include’ and
     ‘--exclude’ options are given, the last matching one wins.  If no
     ‘--include’ or ‘--exclude’ options match, a file is included unless
     the first such option is ‘--include’.
```
[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: Sebastian Carlos <sebaaa1754 <at> gmail.com>
Cc: 63030-done <at> debbugs.gnu.org
Subject: Re: bug#63030: correction
Date: Mon, 24 Apr 2023 13:05:31 -0700
tags 63030 notabug
done

On Sun, Apr 23, 2023 at 5:05 AM Sebastian Carlos <sebaaa1754 <at> gmail.com> 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 searching
> 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.


This bug report was last modified 2 years and 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.