GNU bug report logs - #19825
unified output format, number of consecutive unaffected lines, and POSIX

Previous Next

Package: diffutils;

Reported by: Vincent Lefevre <vincent <at> vinc17.net>

Date: Tue, 10 Feb 2015 02:25:01 UTC

Severity: normal

Tags: notabug

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

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 19825 in the body.
You can then email your comments to 19825 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#19825; Package diffutils. (Tue, 10 Feb 2015 02:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vincent Lefevre <vincent <at> vinc17.net>:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Tue, 10 Feb 2015 02:25:02 GMT) Full text and rfc822 format available.

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

From: Vincent Lefevre <vincent <at> vinc17.net>
To: bug-diffutils <at> gnu.org
Subject: unified output format, number of consecutive unaffected lines, and
 POSIX
Date: Tue, 10 Feb 2015 03:23:48 +0100
Concerning the unified output format, POSIX says in

  http://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html

  "If -U n is specified, the output shall contain no more than
  n consecutive unaffected lines; and if the output contains an
  affected line and this line is adjacent to up to n consecutive
  unaffected lines in the corresponding file, the output shall
  contain these unaffected lines. -u shall act like -U3."

but with GNU diff and n = 3, one can get up to 6 consecutive
unaffected lines:

@@ -1,14 +1,14 @@
 1
 2
 3
-4
+4b
 5
 6
 7
 8
 9
 10
-11
+11b
 12
 13
 14

I actually think that the GNU diff behavior is better than POSIX.
And it is quite strange that POSIX specifies something different
because this format comes from GNU diff!

I think that the GNU diff manual should say something about this
difference. Or could this be regarded as a defect in POSIX?

Note: I noticed this after seeing that Subversion's internal diff
behaves again differently, with a behavior between GNU diff and
POSIX: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777479#17

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




Information forwarded to bug-diffutils <at> gnu.org:
bug#19825; Package diffutils. (Tue, 10 Feb 2015 06:50:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Vincent Lefevre <vincent <at> vinc17.net>, 19825 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#19825: unified output format,
 number of consecutive unaffected lines, and POSIX
Date: Mon, 09 Feb 2015 22:49:35 -0800
Vincent Lefevre wrote:
> Or could this be regarded as a defect in POSIX?

That's what I'd say, yes.  POSIX was intended to codify GNU diff's behavior 
here, and it seems to have missed the corner case you describe.




Added tag(s) notabug. Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 01 May 2016 02:00:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19825 <at> debbugs.gnu.org and Vincent Lefevre <vincent <at> vinc17.net> Request was from Jim Meyering <jim <at> meyering.net> to control <at> debbugs.gnu.org. (Sun, 01 May 2016 02:00: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, 29 May 2016 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 27 days ago.

Previous Next


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