GNU bug report logs - #22838
New 'Binary file' detection considered harmful

Previous Next

Package: grep;

Reported by: Marcello Perathoner <marcello <at> perathoner.de>

Date: Sun, 28 Feb 2016 18:13:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #59 received at 22838 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Marcello Perathoner <marcello <at> perathoner.de>,
 Eric Blake <eblake <at> redhat.com>, 22838 <at> debbugs.gnu.org
Subject: Re: bug#22838: New 'Binary file' detection considered harmful
Date: Tue, 1 Mar 2016 09:14:08 -0800
On 03/01/2016 02:05 AM, Marcello Perathoner wrote:
> 1) Make the new behaviour an opt-in.

Again, this is arguing over what the default should be. For many users, 
the new sort of behavior is better.

>
> 2) If you just output
>
>    binary line 42 in file x matches
>
> and continue regular output after the next newline, the breakage would 
> be much more confined.

This sounds like a good suggestion.  That is, grep could keep going if 
its only problem is an attempt to output encoding errors (as opposed to 
reading null bytes, which are a more-reliable indication of binary 
data).  It would probably be better to output just one "Binary file 
matches" line per file, at the end of the other matches, so that it's 
more likely to be noticed.

>
> 3) Fail in the old documented way of printing only the error message 
> instead of introducing a new mode of failure that looks like success 
> and loses the error message in the noise.

I don't understand this suggestion, as it's not an error or an error 
message.  But since I like (2) better perhaps it doesn't matter.

>
> 4) Don't implement this change between minor releases. A breaking 
> change deserves a major release.
>

Grep does not have minor releases. Whether to call the next release 
"2.24" or "3.0" is primarily a marketing decision, not a technical one.





This bug report was last modified 8 years and 257 days ago.

Previous Next


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