GNU bug report logs -
#20990
RFC: [PATCH] accept new option: --files0-from=F
Previous Next
Reported by: Jim Meyering <jim <at> meyering.net>
Date: Mon, 6 Jul 2015 03:34:02 UTC
Severity: wishlist
Tags: patch, wontfix
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20990 in the body.
You can then email your comments to 20990 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-grep <at> gnu.org
:
bug#20990
; Package
grep
.
(Mon, 06 Jul 2015 03:34:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Jim Meyering <jim <at> meyering.net>
:
New bug report received and forwarded. Copy sent to
bug-grep <at> gnu.org
.
(Mon, 06 Jul 2015 03:34:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Here is a patch to teach grep the --files0-from=F option.
That is the same option that is already supported by wc, du and sort
in the GNU coreutils.
This option allows one to specify NUL-separated file names in the file
argument, F. When I would receive requests to add this option to other
programs from the coreutils, I would refuse, because one can obtain
similar behavior by using xargs like this:
xargs -0 PROGRAM < F
The "use xargs" argument does not work for programs like wc, du and sort.
In those cases, concatenating the output from multiple invocations
(as that xargs usage would do) does not result in the same output as
using --files0-from=F, e.g., because of totals or, for sort, because
the result cannot be the concatenation of separately-sorted outputs.
For most uses of grep, it would be ok to process separate lists of
file names in batches and to concatenate the results, but not with
the --count (-c) option. The count must reflect the total over
all files processed.
Also, more subtly, consider what would happen when the last batch of file
name inputs to xargs happens to contain only one name. The output from
that final invocation of grep (assuming no option like -h or -H) would
omit the "FILENAME:" prefix for any lines matched from that final file.
This patch depends on the perl-based test infrastructure I have just
posted, because the tests are very similar to those for the three tools
from the coreutils.
[0001-accept-new-option-files0-from-F.patch (text/x-patch, attachment)]
Information forwarded
to
bug-grep <at> gnu.org
:
bug#20990
; Package
grep
.
(Mon, 06 Jul 2015 13:58:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 20990 <at> debbugs.gnu.org (full text, mbox):
On Sun, Jul 5, 2015 at 8:32 PM, Jim Meyering <jim <at> meyering.net> wrote:
> Here is a patch to teach grep the --files0-from=F option.
> That is the same option that is already supported by wc, du and sort
> in the GNU coreutils.
>
> This option allows one to specify NUL-separated file names in the file
> argument, F. When I would receive requests to add this option to other
> programs from the coreutils, I would refuse, because one can obtain
> similar behavior by using xargs like this:
>
> xargs -0 PROGRAM < F
>
> The "use xargs" argument does not work for programs like wc, du and sort.
> In those cases, concatenating the output from multiple invocations
> (as that xargs usage would do) does not result in the same output as
> using --files0-from=F, e.g., because of totals or, for sort, because
> the result cannot be the concatenation of separately-sorted outputs.
>
> For most uses of grep, it would be ok to process separate lists of
> file names in batches and to concatenate the results, but not with
> the --count (-c) option. The count must reflect the total over
> all files processed.
Hmm... *this* --count option does not have that behavior, so it's
not a good justification. This is a per-file and per-output-line count.
> Also, more subtly, consider what would happen when the last batch of file
> name inputs to xargs happens to contain only one name. The output from
> that final invocation of grep (assuming no option like -h or -H) would
> omit the "FILENAME:" prefix for any lines matched from that final file.
And in this case, simply adding '/dev/null' or using -h ensures that
even that unusual case will be handled properly.
Now that I've removed those bits of justification, I'll have to
think more about whether it's worth adding this.
Information forwarded
to
bug-grep <at> gnu.org
:
bug#20990
; Package
grep
.
(Mon, 06 Jul 2015 16:04:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 20990 <at> debbugs.gnu.org (full text, mbox):
Jim Meyering wrote:
> Now that I've removed those bits of justification, I'll have to
> think more about whether it's worth adding this.
Not much justification left, if you ask me (which you don't have to :-).
Information forwarded
to
bug-grep <at> gnu.org
:
bug#20990
; Package
grep
.
(Mon, 15 Aug 2016 22:57:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 20990 <at> debbugs.gnu.org (full text, mbox):
No further comments for a year, so I'll mark this as wontfix for now.
Added tag(s) wontfix.
Request was from
Paul Eggert <eggert <at> cs.ucla.edu>
to
control <at> debbugs.gnu.org
.
(Mon, 15 Aug 2016 22:57:02 GMT)
Full text and
rfc822 format available.
Severity set to 'wishlist' from 'normal'
Request was from
Paul Eggert <eggert <at> cs.ucla.edu>
to
control <at> debbugs.gnu.org
.
(Mon, 15 Aug 2016 22:57:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
20990 <at> debbugs.gnu.org and Jim Meyering <jim <at> meyering.net>
Request was from
Paul Eggert <eggert <at> cs.ucla.edu>
to
control <at> debbugs.gnu.org
.
(Sat, 02 Jul 2022 22:27:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 31 Jul 2022 11:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 325 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.