Smart diff handler / open files from the GUI
Kyle Evans <[email protected]>
| Newsgroups | gmane.network.unison.general |
|---|---|
| Message-ID | <[email protected]> |
Hi guys, I started using unison over 10 years ago and fell out of using it
as my habits changed. I'm back to using it as a way to synchronize my
desktop and mobile home folders.
Being that this involves a wide array of file types, are there any smart
diff utilities, or handlers that look at file header and/or mime type to
determine a suitable merge strategy? A good companion script is what I
think I'm looking for.
Along that same line, It would be handy to be able to open a file from the
gui interface to inspect it before deciding what action to take.
Spreadsheet files are particularly problematic.
I defined a quasi merge solution that is not ideal.
merge = Name {*} -> xdg-open CURRENT1 & xdg-open CURRENT2
If I place that before my other defined merge strategies it will open both
files with whatever the default program is for that filetype. It's not
safe, I do not recommend using it. But it does work well on spreadsheet
files, both allowing me to inspect them and manually complete a merge at
the same time. Not all gui programs are created equal though, and while the
sync will pause when LibreOffice is launched, some file types will open in
a herd and unison has no chance to inspect output files.
Since it's not documented, I thought that I would share that to save a
merged file, prepend the string `.unison-mergenew1-`
As my intention was to inspect the file before deciding what to do, my
first attempt was to define the diff command as such.
diff = xdg-open
diff = xdg-open CURRENT1 & xdg-open CURRENT2
Neither of these worked. The first because xdg-open only accepts one
argument. The second I am not sure, but suspect CURRENT1&2 are not valid
variables.
--
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].