[TxMt] Req: Compare docs-Diff

Fred B. fredb7 at starflam.com
Mon Feb 21 09:47:35 UTC 2005


On 19 févr. 05, at 02:37, Eric Hsu wrote:

> At 12:38 PM -0800 2/17/05, Eric Hsu wrote:
>> At 7:46 PM +0100 2/17/05, Torsten Becker wrote:
>>
>> 1. ramp up Torsten's command to output hyperlinked diffs, so clicking 
>> on the diff jumps to the appropriate document and line;
>>
>> 2. (less obvious) use Applescript to move the two original windows 
>> side by side and put the diff output in a lower window.
>
> Okay, I wasted a lot of time today doing #1 above. It now shows the 
> changes in color inline with the unchanged parts of the document. 
> Clicking on a line takes you to the newer version (or if it's a 
> deletion) to the older version.
>
> I had wanted to add cool links (like in the Subversion Log command) to 
> show/hide the common parts and also allow switching which document was 
> considered the newer one. As it is now, whichever one appears first in 
> the TM project drawer is the 'older' one.
>
> It's a start. I think it can become cooler with time.
>


The command doesn't appear when I install it. I tried to remove the 
older Diff.bundle, but that didn't make the trick, maybe I'm missing 
something.
I copy/pasted it but couldn't figure how to load the css files locally. 
No problem if I put them on a server. But I didn't took the time to 
figure it out, maybe I'm missing something again. Plus, external css 
files are loaded after the the html ouptut is completed, not that nice 
as it is slow.

(BTW, why is the html output much more slower than html preview? It can 
be 30 times slower on big files.)

Back to your command:
There is some @@......@@ lines appearing in the output (offsetting the 
links).
I was trying on two css files.

Then, I made some thinking/testing with your command.
After spending a lot of time trying.. lot of things (in Ruby, Perl 
doesn't like me ;), I thought someone should already have made a diff 
to html script and after a lot of time again, I found one. It's called 
hdiff and you can find it here:http://www.ginini.com/software/hdiff/ . 
It's a Perl script that parses the diff -u output in html, putting the 
two docs side-by-side and colorizing "Line added, line removed and line 
changed. It offset the docs when there is line added or removed, too.
That looks quite cool.

So, I thought I could try to link the line numbers to TM files, but:
First, the hdiff's -n (put the line number in front of every line) 
option was broken (if I'm right an "$$" that should be "$" @ line 144.)
Then I realized the line numbers where just the start of the ranges, 
not every lines :(

To add link to TM files is easy, but I don't know if it's even possible 
to output each line number, but if it's possible that could be a pretty 
nice solution.

I'll look more into it in the coming days, either with hdiff  
(But...Perl :( I might even try to rewrite everything in Ruby.),
or with your script, Eric.

Any answers/idea are welcome.

Sorry to be longish.




More information about the textmate mailing list