This site will look much better in a browser that supports web standards, but is accessible to any browser or Internet device.

Anomaly ~ G. Wade Johnson Anomaly Home G. Wade Home

January 24, 2007

A confluence of tools

I don't often write about something quite this geeky, but it is just too cool not to share.

First

Several months ago, I read about an interesting module for Linux called SSHFS. This module allows you to mount a file system over SSH. This gives a way to access files on another server that you don't have any form of shared access such as NFS or Windows shares. All you need is SSH access to the machine that you want to access. It sounded interesting, but I didn't really have a need for it.

Second

A few months ago, I had been doing a lot of work that involved comparing two source code trees. Depending on various factors, I would move some changes from one of the trees to another. I spend a lot of my time in the gvim editor and I've found the gvimdiff mode to be quite helpful for this sort of editing.

Third

Unfortunately, gvimdiff only compares two files, not two directory trees. I had wrapped some scripting around my gvimdiff call to provide some support for the directory merge, but it was awkward and not very pleasant. While looking for something else, I stumbled across the DirDiff vim script. This did exactly what I wanted. I mapped a couple of function keys to diffget and diffput to simplify my work. Life was good.

Stir

Then one day, I needed to work on some files on another server where I had SSH access. I used SSHFS to mount the other system and found working that way to be quite comfortable. I was looking at files on the two systems and without thinking executed DirDiff to compare the differences. After working my way through a few files, it hit me what I was doing. I had files from one machine open in the left window and files from another open in the right window and I was copying bits of code back and forth between the two machines without any real effort.

In some circumstances, (like the one I was in) this is incredibly useful. Much more useful than copying files back and forth or making little changes and uploading files. I wasn't completely replicating the files on both servers, so an rsync approach would not work.

I know this won't be useful (or interesting) to everyone, but it really made my life easier.

Posted by GWade at January 24, 2007 10:08 PM. Email comments