Text file Diff and Merge

Talk about anything
DaveT1
Posts: 218
Joined: 07 Oct 2014, 11:23

Text file Diff and Merge

Post by DaveT1 » 04 Jan 2021, 15:12

Hi,

Hope this is the right forum......I'm wondering where I might find Windows utilities for:

a) producing and storing the differences between text files (are these called 'patch' files?), and

b) subsequently merging these difference files to recover original or intermediate files?

Both to run silently, ie., not looking for a visual / UI means of achieving this.

I've done a whole pile of interneting and, whilst I can turn up no end of revision / version control systems, I can't seem to find the underlying utilities I'm assuming these must be based on.

Most grateful for any thoughts / pointers in the right direction.

Cheers.
Last edited by BoBo on 04 Jan 2021, 16:00, edited 1 time in total.
Reason: Moved to Offtopic.

User avatar
hoppfrosch
Posts: 443
Joined: 07 Oct 2013, 04:05
Location: Rhine-Maine-Area, Hesse, Germany
Contact:

Re: Text file Diff and Merge

Post by hoppfrosch » 06 Jan 2021, 00:48

Why not use the same tools on Windows as on Unix?
see for example: https://stackoverflow.com/questions/6877238/what-is-the-windows-equivalent-of-the-diff-command

a.) Yes - as far as I understand your request, you are looking for tools creating a patch-file. The common tool for creating patch files via command line is "diff".
b.) Recovering original files? Are you asking for something like reverse patching? (having a patched file and wanting to "unpatch"). There seems to exist a UNIX-tool called "interdiff" (see https://stackoverflow.com/questions/30603958/what-does-interdiff-do-that-diff-cannot), but I haven't used it yet and do not know, whether its available in Windows.


DaveT1
Posts: 218
Joined: 07 Oct 2014, 11:23

Re: Text file Diff and Merge

Post by DaveT1 » 07 Jan 2021, 07:04

Very many thanks BoBo and Hoppfrosch, really appreciate your thoughts. My googling had taken me to similar places, but, and demonstrating my total ignorance:
Why not use the same tools on Windows as on Unix?
I can do this? Do I simply take the .exe and invoke it via cmd console (eventually via AUTOHOTKEY Run or RunWait)?
Are you asking for something like reverse patching?
Err, I think so :think: ! I would like to be able to track the evolution of a text file by noting the changes, or deltas, and then re-build any instance of that file by merging the appropriate set of 'deltas'.
(Basically I'm trying to see if I can build a really really simple revision / version control system based on file deltas. I've nearly finished writing one for whole files, which is fine for small projects, but am looking at the possibility of using deltas to be more 'grown-up' ;) .)
Sorry BoBo, I couldn't get that link to resolve!?

Thanks again for your ideas :thumbup: .

ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: Text file Diff and Merge

Post by ahk7 » 07 Jan 2021, 14:38

You might try busybox, a single executable that includes many standard unix tools incl diff + patch which is what you need, you can download a windows version here https://frippery.org/busybox/

Post Reply

Return to “Off-topic Discussion”