git-annex/doc/git-annex-find.mdwn
Joey Hess 904be4e6be
add --branch option to git-annex find and mildly deprecate findref in favor of it
No deprecation warning at run time, just one on the man page.

One thing findref remains able to do that find cannot is to run in a bare
repo. Find was made to refuse to run in a bare repo because it seemed
confusing for it to not list any files ever in that situation. It would be
better for find --branch to work in a bare repo but not without --branch
but I don't currently have a way to do that.

Probably a better solution would be to make git-annex in a bare repo
default to --branch master or something like that instead of --all.

This commit was sponsored by Denis Dzyubenko on Patreon.
2018-12-09 14:10:37 -04:00

92 lines
2.3 KiB
Markdown

# NAME
git-annex find - lists available files
# SYNOPSIS
git annex find `[path ...]`
# DESCRIPTION
Outputs a list of annexed files in the specified path. With no path,
finds files in the current directory and its subdirectories.
# OPTIONS
* matching options
The [[git-annex-matching-options]](1)
can be used to specify files to list.
By default, the find command only lists annexed files whose content is
currently present. Specifying any of the matching options will override
this default behavior.
To list all annexed files, present or not, specify `--include "*"`.
To list annexed files whose content is not present, specify `--not --in=here`
* `--branch=ref`
List files in the specified branch or treeish.
* `--print0`
Output filenames terminated with nulls, for use with `xargs -0`
* `--format=value`
Use custom output formatting.
The value is a format string, in which '${var}' is expanded to the
value of a variable. To right-justify a variable with whitespace,
use '${var;width}' ; to left-justify a variable, use '${var;-width}';
to escape unusual characters in a variable, use '${escaped_var}'
These variables are available for use in formats: file, key, backend,
bytesize, humansize, keyname, hashdirlower, hashdirmixed, mtime (for
the mtime field of a WORM key).
Also, '\\n' is a newline, '\\000' is a NULL, etc.
The default output format is the same as `--format='${file}\\n'`
* `--json`
Output the list of files in JSON format.
This is intended to be parsed by programs that use
git-annex. Each line of output is a JSON object.
* `--json-error-messages`
Messages that would normally be output to standard error are included in
the json instead.
* `--batch`
Enables batch mode, in which a file is read in a line from stdin,
its information displayed, and repeat.
Note that if the file is not an annexed file, or is not present,
or otherwise doesn't meet the matching options, an empty line
will be output instead.
* `-z`
Makes the `--batch` input be delimited by nulls instead of the usual
newlines.
# SEE ALSO
[[git-annex]](1)
[[git-annex-whereis]](1)
[[git-annex-list]](1)
# AUTHOR
Joey Hess <id@joeyh.name>
Warning: Automatically converted into a man page by mdwn2man. Edit with care.