[Unison-hackers] Idea: add support for rsync-style filter files

martin f krafft madduck at madduck.net
Wed Feb 4 15:33:06 EST 2015


also sprach Benjamin C. Pierce <bcpierce at cis.upenn.edu> [2015-02-04 15:59 +0100]:
> Most of this functionality is already present in Unison’s existing
> preferences.

Really? Filter files?

> There may be room for small extensions, but the main design issue
> is dealing with situations where the set of paths to be ignored is
> different (for whatever reason) on the client and server.

Well, my proposed solution is not to look at the two sets of paths,
but only to look at one of them.

I've hacked up a few stupid scripts now, which create include files
in ~/.unison using find(1), e.g.:

  find $HOME -type d -name .git -printf '%h\n' \
    | sed -e "s,${HOME}/,ignore = BelowPath ,"

to ignore all paths where there's a .git directory, or

  … -type f -name .unison-ignore …

to "tag" paths to ignore with touch(1).

I am currently working on a poor-man's rsync-filter-spec parser to
turn simple filter files into such include files, e.g. a file
~/foo/bar/.backup-filter containing

  - bigfiles
  - /cache

would be turned into

  ignore = Regex foo/bar/(.+/)*bigfiles
  ignore = BelowPath foo/bar/cache

and then I just simply run that script before I run unison to
generate all these ignore specs. It effectively does the same as
what I am proposing, I think, but I can tell you that this
poor-man's rsync-filter-spec parser is not making me happy! ;)

-- 
@martinkrafft | http://madduck.net/ | http://two.sentenc.es/
 
"out of the crooked timber of humanity,
 no straight thing was ever made."
                                                       -- imanuel kant
 
spamtraps: madduck.bogus at madduck.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: digital_signature_gpg.asc
Type: application/pgp-signature
Size: 1107 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)
URL: <http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20150204/59bf1d70/attachment.asc>


More information about the Unison-hackers mailing list