Hello!
How can I have just a single directory unlocked at all times?
• I’m running the Assistant.
• If a new file is created in it, I’d like it to be added to annex BUT automatically unlocked (kept editable).
• If such an unlocked file is changed, I’d like the Assistant to sync the change.
How can this be configured?
Thank you!
Whoa.
I just upgraded my repo to v6 (6.20170520), and it seems that a running assistant is adding every new file unlocked. :-o
How can I control which file will get added unlocked and which locked by the assistant?
But it’s better. As a dirty workaround, I could add a cron job/timer that would periodically git-annex-lock all files except that single directory I want unlocked.
But a static configuration—say, in .gitattributes—would be way better. ♥
Or is there a way to configure that already?
There's the annex.addunlocked setting which controls this in v6 repositories, but it's currently limited to true/false, can't configure different behavior in different directories.
I'd probably need a motivating example to make it configurable in .gitattributes. Having a hard time currently understanding how that would be useful.
My particular example is that I’m using git-annex:
• mostly as an archive (esp. in family files context),
• but also as a sort-of FLOSS Dropbox for some specific files, that we’re editing.
I’d like to prevent easy (accidental, really) editing of those archived files.
Does this make sense?
Thank you!
i have recently found a use case for a feature like this.
My use case is that i have an annex that hosts and backs up all my familys files. most of these files are things like pictures. but some of these are also going to be files that my family and i are actively modifying (i.e a personal wiki) and whenever we add a new file to the wiki files, it would be nice to have the assistant automatically add and synchronize changes, but it always adds the new ones as locked files, so we have to go in and unlock them. So i think it would e useful to have a configuration where you give it a list of directories you where you would like git-annex to add the files and any files added to these directories are immediately unlocked I realize that we could probably just go with the workflow of adding these mostly text files to git instead of git-annex, but i like being able to backup these files to all of the "special" backup remotes that i have the other files synchronizing with.
hope this made sense
The annex.addunlocked config is able to do this, since version 7.20191230. It can be set to a git-annex-matching-expression eg "include=wiki/*" would make files in the top-level wiki directory always be added unlocked, and other files would be added locked. Matching on file extensions etc is also possible.