[Top][All Lists]

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

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

From: Ralf Wildenhues
Subject: Re: patch: do not emit trailing blanks in context header
Date: Tue, 7 Nov 2006 16:18:45 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Reviving a rather oldish thread (thus quoting generously):

Paolo Bonzini <paolo.bonzini <at> lu.unisi.ch> writes:
> >
> > 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.

AFAICS, Solaris 10 patch is _not_ resilient against missing trailing blanks.
(It does have a few other quirks with unified diffs that GNU patch does not.)

FWIW, I really wonder whether it's not way easier to adjust the modern
editor to not mistakenly flag trailing white space stemming from diff
output, rather than force a file format change upon old tools. (Simply
ignoring lines matching '^[\t ]*- $' would probably be enough for all
practical purposes.)


reply via email to

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