bug-diffutils
[Top][All Lists]
Advanced

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

[bug-diffutils] diff: ignore empty lines during *alignment* of lines?


From: Michael Brand
Subject: [bug-diffutils] diff: ignore empty lines during *alignment* of lines?
Date: Wed, 23 Mar 2011 17:32:21 +0100

Hi all

Is there a way to tell diff to not use any empty line, that occurs in
both files, for alignment of the lines from both files? I tried `diff
--side-by-side --width=28 diff1.txt diff2.txt' of diffutils 3.0 with
various options and get always:

----------------
a               a
{               {
    aa1      |      aa2
}            <

b            |      aa2
{            <
    bb1      <
}               }

y            |  b
{               {
    yy       |      bb2
}               }
----------------

but would like to get:

----------------
a               a
{               {
    aa1      |      aa2
             >
             >      aa2
}               }

b               b
{               {
    bb1      |      bb2
}            <
             <
y            <
{            <
    yy       <
}               }
----------------

just similar to what I can get already now if I remove all empty lines
in the input files, shown in this output:

----------------
a               a
{               {
    aa1      |      aa2
             >      aa2
}               }
b               b
{               {
    bb1      |      bb2
}            <
y            <
{            <
    yy       <
}               }
----------------

I tried to find out myself but always only found hints like
`--ignore-blank-lines' which do not help in my case. Removing the
empty lines in the input is not really helpful because I would like to
use the diff output to patch the original files or as an input for an
editor which allows to edit the original files shown together with the
highlighted differences.

Please reply to me too because I am not subscribed to the list.

Michael

Attachment: diff1.txt
Description: Text document

Attachment: diff2.txt
Description: Text document


reply via email to

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