git-annex/doc/git-annex-info.mdwn
Joey Hess 1d1054faa6
added -z
Added -z option to git-annex commands that use --batch, useful for
supporting filenames containing newlines.

It only controls input to --batch, the output will still be line delimited
unless --json or etc is used to get some other output. While git often
makes -z affect both input and output, I don't like trying them together,
and making it affect output would have been a significant complication,
and also git-annex output is generally not intended to be machine parsed,
unless using --json or a format option.

Commands that take pairs like "file key" still separate them with a space
in --batch mode. All such commands take care to support filenames with
spaces when parsing that, so there was no need to change it, and it would
have needed significant changes to the batch machinery to separate tose
with a null.

To make fromkey and registerurl support -z, I had to give them a --batch
option. The implicit batch mode they enter when not provided with input
parameters does not support -z as that would have complicated option
parsing. Seemed better to move these toward using the same --batch as
everything else, though the implicit batch mode can still be used.

This commit was sponsored by Ole-Morten Duesund on Patreon.
2018-09-20 16:11:47 -04:00

70 lines
1.6 KiB
Markdown

# NAME
git-annex info - shows information about the specified item or the repository as a whole
# SYNOPSIS
git annex info `[directory|file|treeish|remote|uuid ...]`
# DESCRIPTION
Displays statistics and other information for the specified item,
which can be a directory, or a file, or a treeish, or a remote,
or the uuid of a repository.
When no item is specified, displays statistics and information
for the repository as a whole.
# OPTIONS
* `--fast`
Only show the data that can be gathered quickly.
* `--json`
Enable JSON output. 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.
* `--bytes`
Show file sizes in bytes, disabling the default nicer units.
* `--batch`
Enable batch mode, in which a line containing an item is read from stdin,
the information about it is output to stdout, and repeat.
* `-z`
Makes the `--batch` input be delimited by nulls instead of the usual
newlines.
* file matching options
When a directory is specified, the [[git-annex-matching-options]](1)
can be used to select the files in the directory that are included
in the statistics.
# EXAMPLES
Suppose you want to run "git annex get .", but
would first like to see how much disk space that will use.
Then run:
git annex info --fast . --not --in here
# SEE ALSO
[[git-annex]](1)
# AUTHOR
Joey Hess <id@joeyh.name>
Warning: Automatically converted into a man page by mdwn2man. Edit with care.