bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tests/yesno.sh, kinds of line (matching/non-matching, selected/rejec


From: Julian Foad
Subject: Re: tests/yesno.sh, kinds of line (matching/non-matching, selected/rejected)
Date: Sun, 13 Nov 2005 17:36:03 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511

Charles Levert wrote:
I created a new test file, tests/yesno.sh.
(Test feature interaction of -C, -v, -o, and -m.)

Excellent.

Having more of these is never a bad thing, so
I went ahead and committed it to CVS right away.
It can always be modified to address the issues
it raises, or code and documentation can be.

Fair enough, but I think some of the "expected" strings are wrong.

Tests 4 and 16: we made a design decision that the "only-matching" mode overrides context lines, and without context lines we shouldn't expect to see a group separator "--".

I'll address tests 11 and 27 in a separate reply about context lines and 
max-count.


On 2005-06-21, I committed a bunch of changes,
[... including bugs ...]
(And it did go unnoticed.)

Since we all had a chance to review and test it, we all share the responsibility for the bugs.


You can see by my design of the GREP_COLORS
framework that I just plain forgot about -v and
confused things:

   ml:  terminfo-like string capability for matching lines
   cx:  terminfo-like string capability for context lines
[...]
Should I have created something like this:

   ml:  terminfo-like string capability for matching lines
   nl:  terminfo-like string capability for non-matching lines

Or, like this:

   sl:  terminfo-like string capability for selected lines
   rl:  terminfo-like string capability for rejected lines

This last pair, roughly; certainly the first of the pair should be "selected" and not "matching".

The two sorts of lines that Grep prints (and which should be distinguishable by colour) are the ones it was asked to find (selected lines), and context lines (which are some of the rejected lines). It only prints rejected lines if and when they are context lines. Therefore I think it is clearer to call the printed non-selected lines "context lines" rather than "rejected lines":

  sl:  terminfo-like string capability for selected lines
  cx:  terminfo-like string capability for context lines

[...]
Is it too late to just incompatibly change this,
since there hasn't been an offical release
since the ill-designed version was introduced?

No, it's not too late. This is all experimental until we release it. I'm glad you discovered this problem before we have made a release.


- Julian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]