bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: patch: do not emit trailing blanks in context header


From: Paolo Bonzini
Subject: Re: patch: do not emit trailing blanks in context header
Date: Tue, 05 Sep 2006 16:58:19 +0200
User-agent: Thunderbird 1.5.0.5 (Macintosh/20060719)


You can see that it works using the example above.  Give patch
the diff -u output with the sole trailing blank removed:

  $ printf 'a\n\nb\n' > 1
  $ diff -u <(printf 'a\n\nb\n') <(printf 'a\n\nc\n')|sed 's/ $//'|patch 1 -
  patching file 1

Of course, we're not talking about trailing blanks added or changed due
to inputs with differences (or in context).  Rather, we're talking
about the fact that diff -u adds a space on any output line
what would otherwise be blank.
Yes, but still I am really not sure that it is a good idea. Andreas is sure is a bad one, it looks like. :-)

Patch-handling programs had better be resilient against trailing blanks for sure, since patches are often cut-n-pasted from mail, and it is good that patch 2.5.9 is (I have 2.5.8 actually).

But this does not mean that all of them *are* resilient. I think the unified diff format should be considered as mostly set in stone.

Paolo




reply via email to

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