fourier / ztree

Directory tree comparison mode for Emacs
http://www.emacswiki.org/emacs/ZtreeDiff
GNU General Public License v3.0
239 stars 21 forks source link

Feature request: Directory comparison from multiple hosts #49

Open t-chab opened 7 years ago

t-chab commented 7 years ago

It would be nice if ztree-diff allowed comparison from two directories on different hosts (via tramp).

fourier commented 6 years ago

The problem is what the backend for file comparison is still the simple diff utility, which doesn't work over the network. If you have any ideas on how it could be solved please write here. I'll keep this issue open until we find some way forward.

ylluminarious commented 6 years ago

@fourier I haven't dug into the ztree sources, so I'm not exactly sure how you do things. But I have some ideas for how you could get this feature into ztree. First off, you could use rsync to determine which files are different on local and remote hosts. The option to use for this is --dry-run (-n for short). This doesn't show you a diff in and of itself, but it lets you determine which files are different. You could obviously add some more options to make the output more to your liking. Here's the rsync man page for reference.

To do an actual diff with remote files, Ediff says that it already supports this.

The only problem that I can think of off the top of my head is rsync's limitations on how many remote files you can use. In other words, rsync only lets you use one remote file in your inputs. The other file has to be local. There are some workarounds for this, but I'm not sure whether you'd be interested in them yet.