This commit is contained in:
parent
6c60e1d715
commit
cf7249d00c
1 changed files with 43 additions and 0 deletions
43
doc/todo/Make_addunlocked_configurable_like_largefiles.mdwn
Normal file
43
doc/todo/Make_addunlocked_configurable_like_largefiles.mdwn
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue