wdiff-dev
[Top][All Lists]
Advanced

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

[wdiff-dev] Re: Membership request for group wdiff


From: Martin von Gagern
Subject: [wdiff-dev] Re: Membership request for group wdiff
Date: Tue, 30 Mar 2010 11:18:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100322 Thunderbird/3.0.3

Dear Gilles,

Today I've stumbled upon your application for membership in the wdiff
group. I realize that has been over a year ago, at a time when I hadn't
even been maintainer to the GNU wdiff project. Nevertheless, I now
welcome you as a group member.

In your original application you wrote:

On 12.03.2009 05:15, Gilles B. wrote:
> I use wdiff a lot. So I'd like to contribute to this useful piece of
> software.
> 
> In particular, I'd like to correct small (but disturbing) limitations of
> wdiff: for instance some space or tab differences are hidden.
> 
> Exple:
> -- Content of A.txt : --
> \begin{figure}[t]
>        \centering
>                \includegraphics[width=0.75\linewidth]{./figures/BRPC.eps}
>        \caption{Operations of BRPC for computing a path from $s$ to $t$ with
> the minimum number of hops along the sequence AS1-AS2-AS3}
> \label{fig:BRPC}
> \end{figure}
> 
> -- Content of B.txt (just an additional tab in front of \label): --
> \begin{figure}[t]
>        \centering
>                \includegraphics[width=0.75\linewidth]{./figures/BRPC.eps}
>        \caption{Operations of BRPC for computing a path from $s$ to $t$ with
> the minimum number of hops along the sequence AS1-AS2-AS3}
>        \label{fig:BRPC}
> \end{figure}
> 
> -- result of wdiff: --
>> wdiff -3 a.txt b.txt
> 
> 
> ======================================================================
> 
> -- result of diff: --
>> diff a.txt b.txt
> 
> 5c5
> < \label{fig:BRPC}
> ---
>>       \label{fig:BRPC}

If you are still interested in addressing this thing, I'd like you to
file a bug report at savannah, with Severity 1 (Wish) and assigned to
you. This would provide a useful place to keep a record of discussions
about this topic. Your message above might be a good starting point.

Currently wdiff only passes word lists to diff. Therefore changes in
whitespace won't get detected. The whitespace is retained so it can be
recombined with the original input, but for text without word
differences, the whitespace is simply taken from one of the input
versions, without regard for differences.

I don't know how difficult it would be to change this behaviour, but it
should be possible, and I can see there are cases where it would be useful.

One approach that I can think of would be transforming whitespace into
lines for diff as well. To distinguish them from word lines, they could
start with a space. After that, the different forms of whitespace could
be encoded as characters, e.g. s for space, t for tab, n for line feed
and r for carriage return. That way sequences of whitespace would be
treated as a unit, and it would become possible to include original
newlines in such lines passed to diff.

If you want to investigate this further, I suggest you grab a copy of
the current bzr source tree:
$ bzr branch sftp://bzr.savannah.gnu.org/srv/bzr/wdiff/trunk
If you make modifications to the code, you can set up a separate branch
for this feature, e.g. under
sftp://bzr.savannah.gnu.org/srv/bzr/wdiff/branches/whitespace or similar.

If you don't want to work with bzr, then writing patches is all right as
well. Just let me know what you prefer. Should you require any help
using bzr, I'm willing to provide that as well.

If you succeed implementing code to detect whitespace differences, would
you be willing to assign the copyright to the Free Software Foundation,
so that we could install it in official GNU wdiff releases? If so, I'll
send you an e-mail with the appropriate request form, so you can start
early on the paperwork, ensuring it won't hold up the feature in the end.

Greetings,
 Martin von Gagern

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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