gnu-misc-discuss
[Top][All Lists]
Advanced

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

Re: Diff too difficult


From: Barry
Subject: Re: Diff too difficult
Date: 27 Dec 2005 19:17:08 -0800
User-agent: G2/0.2

Alfred M. Szmidt wrote:

> The lines aren't identical, the line-ending is different, they show up
> the same on your display though.  diff shows _differences_, which is
> why you didn't see any more text, since diff couldn't find any more
> differences between the two files.

One file had a blank line after </body> and it wasn't indicated clearly
enough, if at all. There was no line number mentioned, no human
readable indication of what the extra character was (a CR), no previous
or subsequent line for context (though I read that's available with -c)
and no clearly delimited comparison between lines in each file. There
was also the "61d60" to ugly up the output, which I'd have to edit out
for public viewing.


> You are looking at the difference between two files, if those files
> have long lines, so will the output, anything else would be silly
> since it would give you a false view of what the difference between
> the two files are.  If you are looking for a word based difference
> program, try wdiff, it is also from the GNU project, and is avaiable
> at the usual place.

I want it all. I've seen output somewhere that showed a gray arrow at
the end of some lines to indicate that a line break was added for
readability. I like that, and if line breaks were added without the
arrows to indicate it, that would be ok too. If there's no code for the
blank line between my </body> and </html> tags, and there's no code for
different line ending characters, I don't think lines that are
thousands of characters long should be output by default just for
accuracy.


>    Someone suggested that I try diff -u. It also gave me confusing
>    output on the same two files:
>
> You haven't explained what is confusing.  It shows three changes, one
> line that was replaced by another (one that contains the line-ending
> difference), and a single line that was removed.  Both are in two
> different hunks (once again see the diff manual for details).

The "@@ -58,5 +58,4 @@" is confusing. There's also no indication of
which file is missing the blank line between the two closing tags.


> diff only truncates lines because you told it to, once again you have
> failed to read the documentation for the tool you are trying to use:
>
>   -w NUM  --width=NUM  Output at most NUM (default 130) columns per line.

I read that part. It truncates by default, which isn't exactly what
someone tells it to do, but I'm not complaining about that. I was
referring to what I read at
http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/cmds/aixcmds5/sdiff.htm
saying "The sdiff command uses 2048 if a value greater than 2048 is
specified." That isn't mentioned in the gnu sdiff documentation that I
previously linked to, so I guess they could be different versions. I
forgot about the "man sdiff" command, so I don't know what that says
yet. I only tried "help sdiff" which wasn't available.


> Really, this is all documented in the manual.  Before you reply to
> this message, read the diff manual, please.

I'm sure that would help. It's just that I'd like it to be easier.


reply via email to

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