bug-diffutils
[Top][All Lists]
Advanced

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

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


From: Michael Brand
Subject: [bug-diffutils] Re: diff: ignore empty lines during *alignment* of lines?
Date: Sat, 9 Apr 2011 13:11:28 +0200

Hi again

I would be happy if someone could look into this. Maybe I was not
clear enough before and also examples in unified format would have
been better. So let me explain in a different way.

diff on Solaris 5.10 outputs this:

----------------
 a
 {
-    aa1
+    aa2
+
+    aa2
 }

 b
 {
-    bb1
-}
-
-y
-{
-    yy
+    bb2
 }
----------------

and diff of GNU diffutils 2.8.1 or 3.0 outputs this:

----------------
 a
 {
-    aa1
-}
+    aa2

-b
-{
-    bb1
+    aa2
 }

-y
+b
 {
-    yy
+    bb2
 }
----------------

Now my question is: Are there options in diff of GNU diffutils that
can be used to get the same output like in the above example with diff
on Solaris 5.10?

The input files are:
----------------
a
{
    aa1
}

b
{
    bb1
}

y
{
    yy
}
----------------

----------------
a
{
    aa2

    aa2
}

b
{
    bb2
}
----------------

Michael


2011/3/23 Michael Brand <address@hidden>:
> 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



reply via email to

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