git-annex/doc/git-annex-info.mdwn

99 lines
2.6 KiB
Text
Raw Normal View History

# NAME
2019-01-16 18:16:10 +00:00
git-annex info - information about an item or the repository
# SYNOPSIS
git annex info `[directory|file|treeish|remote|description|uuid ...]`
# DESCRIPTION
2023-11-06 15:11:50 +00:00
Displays statistics and other information for the specified item.
When no item is specified, displays overall information. This includes a
list of all known repositories, how much annexed data is present in the
local repository, and the total size of all annexed data in the working
tree.
2023-11-06 15:11:50 +00:00
When a directory is specified, displays information
about the annexed files in that directory (and subdirectories).
This includes how much annexed data is present in the local repository,
the total size of all annexed data in the directory, how many files
have the specified numcopies or more (+1, +2 etc) or less (-1, -2 etc),
and information about how much of the annexed data is stored in known
repositories.
When a treeish is specified, displays similar information
as when a directory is specified, but about the annexed files in that
treeish.
When a remote, or description of a repository, or uuid is specified,
displays information about the specified repository, including the total
amount of annexed data stored in it, and a variety of configuration
information.
# OPTIONS
* `--fast`
2023-11-06 15:11:50 +00:00
Only show the information 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.
2015-04-12 18:08:40 +00:00
* `--bytes`
Show file sizes in bytes, disabling the default nicer units.
2016-01-15 19:56:47 +00:00
* `--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.
* `--autoenable`
Display a list of special remotes that have been configured to
autoenable.
* `--dead-repositories`
Display a list of repositories that have been marked as dead.
Such repositories are not displayed in other info displays.
info: Allow using matching options in more situations File matching options like --include will be rejected in situations where there is no filename to match against. (Or where there is a filename but it's not relative to the cwd, or otherwise seemed too bothersome to match against.) The addition of listKeys' was necessary to avoid using more memory in the common case of "git-annex info". Adding a filterM would have caused the list to buffer in memory and not stream. This is an ugly hack, but listKeys had previously run Annex operations inside unafeInterleaveIO (for direct mode). And matching against a matcher should hopefully not change any Annex state. This does allow for eg `git-annex info somefile --include=*.ext` although why someone would want to do that I don't really know. But it seems to make sense to allow it. But, consider: `git-annex info ./somefile --include=somefile` This does not match, so will not display info about somefile. If the user really wants to, they can `--include=./somefile`. Using matching options like --copies or --in=remote seems likely to be slower than git-annex find with those options, because unlike such commands, info does not have optimised streaming through the matcher. Note that `git-annex info remote` is not the same as `git-annex info --in remote`. The former shows info about all files in the remote. The latter shows local keys that are also in that remote. The output should make that clear, but this still seems like a point where users could get confused. Sponsored-by: Jochen Bartl on Patreon
2022-02-21 18:45:11 +00:00
* matching options
info: Allow using matching options in more situations File matching options like --include will be rejected in situations where there is no filename to match against. (Or where there is a filename but it's not relative to the cwd, or otherwise seemed too bothersome to match against.) The addition of listKeys' was necessary to avoid using more memory in the common case of "git-annex info". Adding a filterM would have caused the list to buffer in memory and not stream. This is an ugly hack, but listKeys had previously run Annex operations inside unafeInterleaveIO (for direct mode). And matching against a matcher should hopefully not change any Annex state. This does allow for eg `git-annex info somefile --include=*.ext` although why someone would want to do that I don't really know. But it seems to make sense to allow it. But, consider: `git-annex info ./somefile --include=somefile` This does not match, so will not display info about somefile. If the user really wants to, they can `--include=./somefile`. Using matching options like --copies or --in=remote seems likely to be slower than git-annex find with those options, because unlike such commands, info does not have optimised streaming through the matcher. Note that `git-annex info remote` is not the same as `git-annex info --in remote`. The former shows info about all files in the remote. The latter shows local keys that are also in that remote. The output should make that clear, but this still seems like a point where users could get confused. Sponsored-by: Jochen Bartl on Patreon
2022-02-21 18:45:11 +00:00
The [[git-annex-matching-options]](1) can be used to select what
to include in the statistics.
* Also the [[git-annex-common-options]](1) can be used.
# 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.