37467a008f
* 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.
68 lines
1.7 KiB
Markdown
68 lines
1.7 KiB
Markdown
# NAME
|
|
|
|
git-annex matchexpression - checks if an expression matches
|
|
|
|
# SYNOPSIS
|
|
|
|
git annex matchexpression `expression [data]`
|
|
|
|
# DESCRIPTION
|
|
|
|
This plumbing-level command is given a preferred content expression,
|
|
and some data, and checks if the expression matches the data. It exits 0 if
|
|
it matches, and 1 if not. If not enough data was provided, it displays an
|
|
error and exits with special code 42.
|
|
|
|
For example, this will exit 0:
|
|
|
|
git annex matchexpression "include=*.png and largerthan=1mb" --file=foo.png --size=10mb
|
|
|
|
# OPTIONS
|
|
|
|
* `--file=`
|
|
|
|
Provide the filename to match against. Note that the file does not have
|
|
to actually exist on disk.
|
|
|
|
* `--size=`
|
|
|
|
Tell what the size of the file is. The size can be specified with any
|
|
commonly used units, for example, "0.5 gb" or "100 KiloBytes".
|
|
|
|
* `--key=`
|
|
|
|
Tell what key is being matched against. This is needed for
|
|
matching expressions like "copies=N" and "metadata=tag=foo" and
|
|
"present", which all need to look up the information on file for a key.
|
|
|
|
Many keys have a known size, and so --size is not needed when specifying
|
|
such a key.
|
|
|
|
* `--largefiles`
|
|
|
|
Parse the expression as an annex.largefiles expression, rather than a
|
|
preferred content expression.
|
|
|
|
* `--mimetype=`
|
|
|
|
Tell what the mime type of the file is. Only needed when using
|
|
--largefiles with a mimetype= expression.
|
|
|
|
* `--mimeencoding=`
|
|
|
|
Tell what the mime encoding of the file is. Only needed when using
|
|
--largefiles with a mimeencoding= expression.
|
|
|
|
# SEE ALSO
|
|
|
|
[[git-annex]](1)
|
|
|
|
[[git-annex-preferred-content]](1)
|
|
|
|
[[git-annex-matching-expression]](1)
|
|
|
|
# AUTHOR
|
|
|
|
Joey Hess <id@joeyh.name>
|
|
|
|
Warning: Automatically converted into a man page by mdwn2man. Edit with care.
|