I'm synchronizing my Sites folder on two Macs in the local network. Some Wordpress sites in this folder contain readme.txt
files that are different because of different plugin or theme versions on the two Macs. They differ in file size and timestamp.
My default.prf
has a setting for merging .txt
files:
merge = Name *.txt -> diff3 CURRENT1 CURRENTARCHOPT CURRENT2 > NEW
which works fine for most text files, but not for these readme.txt
files. When I start syncing, Unison gives me merge errors for these files. Here's a typical output:
Contacting server...
Connected [//mac1.local//Users/timm -> //mac2.local//Users/timm]
Looking for changes
Waiting for changes from server
Reconciling changes
local mac1.local
new file <-M-> new file Sites/wp-sites/example.dev/wp-content/plugins/kocuj-sitemap/readme.txt
Proceed with propagating updates? [] y
Propagating updates
UNISON 2.48.4 started propagating changes at 15:21:22.86 on 16 May 2017
Merge command: diff3 '/Users/timm/Sites/wp-sites/example.dev/wp-content/plugins/kocuj-sitemap/.unison.merge1-readme.txt' '/Users/timm/Sites/wp-sites/example.dev/wp-content/plugins/kocuj-sitemap/.unison.merge2-readme.txt' > '/Users/timm/Sites/wp-sites/example.dev/wp-content/plugins/kocuj-sitemap/.unison.mergenew1-readme.txt'
Merge result (exited (2)):
diff3: missing operand after `/Users/timm/Sites/wp-sites/example.dev/wp-content/plugins/kocuj-sitemap/.unison.merge2-readme.txt'
diff3: Try `diff3 --help' for more information.
Saving synchronizer state
Synchronization incomplete at 15:21:24 (0 items transferred, 0 skipped, 1 failed)
failed: Sites/wp-sites/example.dev/wp-content/plugins/kocuj-sitemap/readme.txt
I realise that merge must fail on new files, but I'd think that the program should copy them over rather than trying to merge. I even tried ignoring the (pretty much useless) files:
ignore = Name {Sites/*/readme.txt}
but for some reason Unison doesn't ignore them. The thing is, I need text file merging because I rely on simple text files for my documentation. The default.prf
looks like this:
# default profile
servercmd=/opt/local/bin/unison
root = /Users/timm/
root = ssh://mac2.local//Users/timm/
path = Sites
auto = true
times = true
# ignore permissions
perms = 0
rsrc = false
ignore = Name {.DS_Store}
ignore = Name {.localized}
ignore = Name {*/*.app/*}
ignore = Name {*/temp/*}
ignore = Name {*/cache/*}
ignore = Name {Sites/*/wp-content/languages/*}
ignore = Name {Sites/*/wp-content/plugins/*}
ignore = Name {Sites/*/wp-content/themes/twenty*}
ignore = Name {Sites/*/wp-sites/wordpress/*}
# ???
ignore = Name {Sites/*/readme.txt}
# diff and merge
diff = diff
merge = Name *.txt -> diff3 CURRENT1 CURRENTARCHOPT CURRENT2 > NEW
backup = Name *.txt
backupcurrent = Name *.txt
maxbackups = 10
log = true
logfile = /Users/timm/.unison/unison.log
I'm running Unison 2.48.4 on Mac El Capitan 10.11.6.
Did I overlook a setting? Is there any other way to make Unison copy and not merge new files?