annex.addunlocked expressions

* annex.addunlocked can be set to an expression with the same format used by
  annex.largefiles, in case you want to default to unlocking some files but
  not others.
* annex.addunlocked can be configured by git-annex config.

Added a git-annex-matching-expression man page, broken out from
tips/largefiles.

A tricky consequence of this is that git-annex add --relaxed
honors annex.addunlocked, but an expression might want to know the size
or content of an url, which it's not going to download. I decided it was
better not to fail, and just dummy up some plausible data in that case.

Performance impact should be negligible. The global config is already
loaded for annex.largefiles. The expression only has to be parsed once,
and in the simple true/false case, it should not do any additional work
matching it.
This commit is contained in:
Joey Hess 2019-12-20 15:01:34 -04:00
parent f79bd52132
commit 37467a008f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
25 changed files with 305 additions and 179 deletions

View file

@ -3,3 +3,5 @@ Can the `annex.addunlocked` be extended to have the same syntax as `annex.largef
Basically, I want a reliable way to prevent inadvertently adding files as annexed unlocked files.
Related: [[forum/lets_discuss_git_add_behavior]]
> [[done]] --[[Joey]]

View file

@ -0,0 +1,11 @@
[[!comment format=mdwn
username="joey"
subject="""comment 4"""
date="2019-12-20T19:45:21Z"
content="""
Made annex.addunlocked support expressions like annex.largefiles.
And both of them can be set globally with `git annex config`. I did not
make annex.addunlocked be settable by git attribute, because my sense is
that `git annex config` covers that use case, or mostly so.
"""]]