(Visual) file comparison, aka Diff (Amsdos, CP/M, FutureOs, SymbOS, ...)

Started by madram, 13:01, 20 August 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

madram

Hi and hello,
I'm looking for any tools to compare 2 ascii files. Either giving a diff (best) and/or displaying them both on the screen.
Ok for displaying 2 files SymbOS should do the trick, but automatic comparison is what I'm longing for.


If I recall well, Promerge allows to open 2 files, but can they be compared ?








HAL6128

Don't if it helps but Utopia can compare data in RAM and a file.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Audronic

@madram
I bring the files to a MAC and use HexEdit.
I also use HexEdit to Edit Roms.
Ray
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

HAL6128

...of course NotePad+ on PC side has a good comparing tool.
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

netmercer

Hi,
there is a very useful tool under CP/M, which does this job. It's called "TCOMP.COM" (text compare) and is available from SIG-M disk no. 289 (COMPARE.LBR).

Kind regards
netmercer

TFM

Yes, there are few great tools for CP/M to compare files. Also there is the great ASCII tools for CPC under CP/M Plus.  :)




If you need a tool for FutureOS just let me know, then i will make one. You can use/compare as much files at the same time as you want.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

madram

Thanks all!


@netmercer Which tool do you suggest to unpack LBR files?
@TFM That's quite vague! Mind to name a few?
@Audronic. There was a MACINTOSH emulator on the Atari ST, but nothing like that for CPC I guess.


Transfering files on another machine is not a serious solution!

Audronic

@madram
Were there some older ROMS that had a range of tools in them.? ?
Ray

Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

SRS


TFM

Quote from: madram on 08:57, 22 August 16
@TFM That's quite vague! Mind to name a few?


Wished I could, currently only my work pc runs, so I can't access my own stuff sadly. But you can check the public domain of CP/M in the internet, f.e. SIGM and ZCPR stuff included. It should be still out there.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

netmercer

Hi,

there are several tools for managing libary files, for example the improved "NULU.COM".
I have attached the TCOMP.COM file as RAR for you.
Visit the great "www.gaby.de" homepage for a lot of CP/M stuff and links.

Quote from: madram on 08:57, 22 August 16

Transfering files on another machine is not a serious solution!

You are absolutely right.   :D

Kind regards
netmercer

madram

@TFM  In FutureOs, a visual diff (à la vim -d / meld / kdiff3 / beyond compare ...) would be terrific.

TFM

Quote from: madram on 17:36, 24 August 16
@TFM  In FutureOs, a visual diff (à la vim -d / meld / kdiff3 / beyond compare ...) would be terrific.


Sorry, got no idea about non-Z80 OS/computer. So what does a "vim -d / meld / kdiff3 / beyond compare" do? Or more easy what do you want it to do?
:)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

madram

Visual "diff" allows to easily locate and monitor modifications/insertions/deletions between 2 files, with full context.

One image better than 52 words :



The visualization part is the most needed. In a second time, editing/merge facilities are very welcome.
A smart diff is complex thus/and fun to code, but it doesn't need to be very sophisticated as long as it is offered to manually align some parts (hints for "synchronization points").
 




Prodatron

I never had a deeper look at these algorythms for file comparisons. It's quite a very interestic topic, and I really wonder what is the best methode for that.
The problem for 8bit machines might be the size of the "window" which can be used for the comparison.
E.g. if the part of the source code, which has been added to the new version, is too large, an limited 8bit machine could have some problems?
It was the same issue for decompression algorithms, and I was really glad, that the famouse deflate algorithm (ZIP, GZIP, PNG etc) only requires a 32K "window". But that might be not enough for some file comparisons?

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Munchausen

Quote from: Prodatron on 19:40, 24 August 16
I never had a deeper look at these algorythms for file comparisons. It's quite a very interestic topic, and I really wonder what is the best methode for that.
The problem for 8bit machines might be the size of the "window" which can be used for the comparison.
E.g. if the part of the source code, which has been added to the new version, is too large, an limited 8bit machine could have some problems?
It was the same issue for decompression algorithms, and I was really glad, that the famouse deflate algorithm (ZIP, GZIP, PNG etc) only requires a 32K "window". But that might be not enough for some file comparisons?

There are lots of papers on the topic (was researching them a while back for another task), you're looking at the line oriented longest common subsequence (LCS) problem, the classic (1985/86) algorithm is described in "An O(ND) difference algorithm and its variations" [1] but there will be lots of newer stuff as well.

[1] http://www.xmailserver.org/diff2.pdf

TFM

Quote from: madram on 19:13, 24 August 16
One image better than 52 words :
Indeed. That looks great! The idea with the arrows is nice, so you can transfer blocks from one to another file.
Now it would be fun to have that for more that two files, right? Looks like a fun project on CPC.  :)


Quote from: Munchausen on 12:21, 25 August 16
There are lots of papers on the topic ...
The fun about it so do it without studying other ideas, but to invent a cool and quick algorithm by oneself - IMHO.  ;)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Prodatron

Quote from: Munchausen on 12:21, 25 August 16
There are lots of papers on the topic (was researching them a while back for another task), you're looking at the line oriented longest common subsequence (LCS) problem, the classic (1985/86) algorithm is described in "An O(ND) difference algorithm and its variations" [1] but there will be lots of newer stuff as well.

[1] http://www.xmailserver.org/diff2.pdf
I already suspected, that this isn't a trivial one.
Here is an interesting Wikipedia article about it:
Longest common subsequence problem - Wikipedia, the free encyclopedia
which is mentioned in the diff article:
diff utility - Wikipedia, the free encyclopedia

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

madram


Quote
For displaying 2 files SymbOS should do the trick.


Not quite!

       
  • Via 'type' command launched on two separate symshell, there is a bug: first window also display last opened file. This was quite disturbing at first! Also, it would be nice to have an option to display line number (at least with %P flag, it may display "lines 25-67. Press any key")
  • Notepad only handles ~14k, while my file are ~59k.
Quote
I have attached the TCOMP.COM file as RAR for you.


Thank you very much. TCOMP seems to do a pretty good diff job (mismatch vs insertion/deletion), but :

       
  • absence of context makes the analysis more difficult.
  • I've haven't found a way to automatically pause, and had to manually press CONTROL-S.
  • It leads to memory full ("Error 7. Free space exceeded" or something like that.)

Quote
The fun about it so do it without studying other ideas.

I tend to agree! The constraints on CPC are not quite the same. Prodatron is right, fixed window/look-ahead will limit the size of inserted blocs which can be detected as so. But once again, allowing manual synchronization points (which amounts to internally split files and compare each portion independently) can save the day (I sometimes wish I had them even with modern & sophisticated algorithms).

Quote
Now it would be fun to have that for more that two files, right?

A typical use case is to have one "base" file and two distinct evolutions of this file. Then, a forth window can be needed for the output file (merging the two evolutions)!
But a simple two-way visual diff would be a really good and useful start.   

TFM

Ah, that's actually a good idea (to make a new file out of some source files). Well, we may end up with an file comparing text editior. But why not?  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod