I'm using the version of git-annex in debian bullseye (8.20210223) and a newly created repository (v8). When I put a new file into the repository, the assistant notices and adds it, but the file is then unlocked. Is there a way to tell the assistant to add files in locked mode? This repository is in the "source" group, so contents get dropped soon and the pointer files regularly confuse me
annex.addunlocked
config option tofalse
Thanks for the hint - this doesn't seem to make any difference though. If I unterstand the manpage correctly, adding files in locked form is the default anyway. I tried it to be sure:
and restarted the assistant. The behaviour is the same as before, files are added unlocked.
git checkout master
That's also not it:
The assistant adds files unlocked because it's intended to work for unsophisticated users who would be confused to have the file they saved suddenly turn into a symlink. For that matter, even a sophisticated user might find reasons to be annoyed at that happening without them doing anything.
While it could treat annex.addunlocked not being set to add files unlocked, but honor if if it's set, it seems potentially confusing to make unset and false have different meanings. Also if annex.addunlocked were set globally, there would be no way to put it in the "unset" state in the local repo. Maybe it would be better as a separate config setting for the assistant, eg
annex.assistant.honor.addunlocked
I do not think this will be very easy to implement, unfortunately.
so there remains no way to configure assistant to add files in regular locked mode where files would "migrate" to become symlinks after having been added to annex?
Our use case is the "data acquisition" box (for repronim's reprostim project) which we are configuring to collect videos, which are then to be transferred to another box. Size will be large, we will rely on branches and copies/moves of the files, so having them to be symlinks is kinda "mandatory" to keep operations fast and to not waste space.
while true;git annex assist
done` instead of the assistant.That seems like a resonable use case to me, I've opened a todo allow configuring assistant to add files locked.
I have not revisited looking at how hard it would be to implement such a config option. @yarikoptic if you're needing this for ReproNim I could prioritize doing that.