unison icon indicating copy to clipboard operation
unison copied to clipboard

Add ability to specify custom prog/script to run on each file to decide whether to include or ignore

Open f-aubert opened this issue 2 years ago • 2 comments

It would be great if we can specify a script which would return 0 if the file is to be synced, and a positive value if the file is to be ignored.

It would allow for advanced sync scenarii, for example music sync based on mp3 tags (ie. sync only when Genre is Rock) just by writing a script that read the music file and does the checking. The default prog/script would obviously handle ignore and Include patterns as it does presently.

I'd happily brainstorm with you, if you wish to discuss it further. Thanks

f-aubert avatar Nov 23 '22 20:11 f-aubert

Feel free to bring it up on the unison-hackers list. I don't intend to work on this because it has a pretty low usefulness/effort tradeoff for most users, and I think it will have a lot of issues in implementing. If you want to pursue it, would be good to see a precise design and analysis including efficiency, answering the obvious question of the impact of a process per file, per sync. Note that while I won't be doing this, and I might not even want to merge a PR, you are entirely welcome to implement it and use it privately. A trip report from that exercise would be helpful in a real discussion.

gdt avatar Nov 23 '22 21:11 gdt

This is mentioned in https://github.com/bcpierce00/unison/issues/80#issuecomment-347319726 and a workaround in https://github.com/bcpierce00/unison/issues/80#issuecomment-381113502

tleedjarv avatar Nov 24 '22 08:11 tleedjarv