[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: |
Jim Meyering |
Subject: |
Re: patch: do not emit trailing blanks in context header |
Date: |
Tue, 05 Sep 2006 19:29:45 +0200 |
Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> Do you mean that you *can* fix it for diff -u ?
>
> I proposed a spec for diff -u requiring a trailing space to the POSIX
> folks and it was accepted for draft 2 of the next version (see XCU ERN 103 in
> <http://www.opengroup.org/austin/aardvark/latest/xcubug2.txt>)
>
> We could try to get the spec updated. I guess this wording:
>
> Each unaffected line shall be written in the following
> format:
>
> "^%s", <unaffected_line>
>
> where the contents of the unaffected line shall be taken from
> file1.
>
> would be replaced by:
>
> Each nonempty unaffected line shall be written in the following
> format:
>
> "^%s", <unaffected_line>
>
> where the contents of the unaffected line shall be taken from
> file1. Each empty unaffected line shall be written as either
> an empty line, or a line containing a single space character.
Hi Paul,
That sounds perfect.
> Do you think this change is worth pursuing?
Yes.
Personally, I'd like at least an option to make "diff -u" omit those
unnecessary trailing blanks, if for no other reason than to make it
easier to see any remaining (due to actual differences) trailing spaces.
These days, it's easy to make your editor of choice highlight trailing
blanks, and since they can even cause trouble in some contexts, this
is a good thing to do whenever possible. When examining unified diffs,
any added (or removed) trailing blanks in the files being compared will
be much easier to spot visually, without all of the false positives we
currently see.
> All programs reading patches that I know of treat empty lines the same
> as lines containing a single space, due to the usual problems of
> stripping trailing white space, so I don't think this will pose much
> of a hardship in real life.
Good!
- patch: do not emit trailing blanks in context header, Jim Meyering, 2006/09/04
- Re: patch: do not emit trailing blanks in context header, Paul Eggert, 2006/09/05
- Re: patch: do not emit trailing blanks in context header, Paul Eggert, 2006/09/05
- Re: patch: do not emit trailing blanks in context header,
Jim Meyering <=
- Re: patch: do not emit trailing blanks in context header, Chuck Swiger, 2006/09/05
- Re: patch: do not emit trailing blanks in context header, Paul Eggert, 2006/09/05
- Re: patch: do not emit trailing blanks in context header, Jim Meyering, 2006/09/06