2016-04-20 17:49:42 +00:00
|
|
|
# NAME
|
|
|
|
|
2022-08-03 15:11:10 +00:00
|
|
|
git-annex calckey - calculate key for a file
|
2016-04-20 17:49:42 +00:00
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
|
|
git annex calckey `[file ...]`
|
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
This plumbing-level command calculates the key that would be used
|
|
|
|
to refer to a file. The file is not added to the annex by this command.
|
|
|
|
The key is output to stdout.
|
|
|
|
|
2017-05-09 19:04:07 +00:00
|
|
|
The backend used is the one from the annex.backend configuration
|
2016-04-21 15:23:17 +00:00
|
|
|
setting, which can be overridden by the --backend option.
|
|
|
|
For example, to force use of the SHA1 backend:
|
2016-04-20 17:49:42 +00:00
|
|
|
|
2016-04-21 15:23:17 +00:00
|
|
|
git annex calckey --backend=SHA1 file
|
2016-04-20 17:49:42 +00:00
|
|
|
|
|
|
|
# OPTIONS
|
|
|
|
|
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 20:09:21 +00:00
|
|
|
* `--backend=name`
|
|
|
|
|
|
|
|
Specifies which key-value backend to use.
|
|
|
|
|
2016-04-20 17:49:42 +00:00
|
|
|
* `--batch`
|
|
|
|
|
|
|
|
Enable batch mode, in which a line containing the filename is read from
|
|
|
|
stdin, the key is output to stdout (with a trailing newline), and repeat.
|
|
|
|
|
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 20:09:21 +00:00
|
|
|
* `-z`
|
2016-04-21 15:23:17 +00:00
|
|
|
|
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 20:09:21 +00:00
|
|
|
Makes the `--batch` input be delimited by nulls instead of the usual
|
|
|
|
newlines.
|
2016-04-21 15:23:17 +00:00
|
|
|
|
2021-05-10 19:00:13 +00:00
|
|
|
* Also the [[git-annex-common-options]](1) can be used.
|
|
|
|
|
2016-04-20 17:49:42 +00:00
|
|
|
# SEE ALSO
|
|
|
|
|
|
|
|
[[git-annex]](1)
|
|
|
|
|
|
|
|
# AUTHOR
|
|
|
|
|
|
|
|
Joey Hess <id@joeyh.name>
|
|
|
|
|
|
|
|
Warning: Automatically converted into a man page by mdwn2man. Edit with care.
|