From cf7249d00c8c5fddd5abf93ac33c0b2b20d009c9 Mon Sep 17 00:00:00 2001 From: nobodyinperson Date: Tue, 6 Jun 2023 12:49:11 +0000 Subject: [PATCH] --- ...unlocked_configurable_like_largefiles.mdwn | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/todo/Make_addunlocked_configurable_like_largefiles.mdwn diff --git a/doc/todo/Make_addunlocked_configurable_like_largefiles.mdwn b/doc/todo/Make_addunlocked_configurable_like_largefiles.mdwn new file mode 100644 index 0000000000..226e343ba8 --- /dev/null +++ b/doc/todo/Make_addunlocked_configurable_like_largefiles.mdwn @@ -0,0 +1,43 @@ +Hi joey, + +How about making `annex.addunlocked` configurable similar to `annex.largefiles` so different file types can be configured to be added unlocked and others locked? + +The following illustrates a use case: + +[[!format bash """ +#!/bin/sh -x +# make a repo +export LC_ALL=C.UTF-8 +chmod -R +w addunlocked;rm -rf addunlocked +git init addunlocked +cd addunlocked +git annex init +# configure *.txt files to be added unlocked so they stay editable +echo '*.txt annex.addunlocked=true' > .gitattributes +git add .gitattributes +git commit -m "Add .gitattributes" +# make a note +echo bla > notes.txt +git annex add +git annex sync -m "add notes.txt" +# However editing doesn't work as it was added locked +echo blubb >> notes.txt # fails as it was not added unlocked +"""]] + +Probably not all matching options (like `copies` for example) make sense or work at all in this context, but at least `include=` would be useful („all files in that dir should be added unlocked always”). For example, in a synced folder for collaboration, PDFs could stay locked to save space, but Spreadsheets and ODT documents for example make sense to be added unlocked by default to stay editable. This could be achieved with something like this: + +[[!format bash """ +# repo-wide stored in git-annex branch +git annex config --set annex.addunlocked 'include=*.odt or include=**.pdf' + +# folder-specific via .gitattributes +echo '*.pdf annex.addunlocked=true' >> .gitattributes # (or 'anything') +echo '*.odt annex.addunlocked=true' >> .gitattributes # (or 'anything') + +# repo-specific +git config annex.addunlocked 'include=**/*.odt or include=**/*.pdf' +"""]] + +What do you think? + +Cheers, Yann -- 2.30.2