2015-03-25 16:09:49 +00:00
|
|
|
# NAME
|
|
|
|
|
|
|
|
git-annex fromkey - adds a file using a specific key
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
2016-12-05 14:59:20 +00:00
|
|
|
git annex fromkey `[key file ...]`
|
2015-03-25 16:09:49 +00:00
|
|
|
|
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
This plumbing-level command can be used to manually set up a file
|
|
|
|
in the git repository to link to a specified key.
|
|
|
|
|
2016-12-05 14:59:20 +00:00
|
|
|
Multiple pairs of file and key can be given in a single command line.
|
|
|
|
|
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
|
|
|
If no key and file pair are specified on the command line, batch input
|
|
|
|
is used, the same as if the --batch option were specified.
|
2015-03-25 16:09:49 +00:00
|
|
|
|
2015-05-23 02:41:36 +00:00
|
|
|
Normally the key is a git-annex formatted key. However, to make it easier
|
|
|
|
to use this to add urls, if the key cannot be parsed as a key, and is a
|
|
|
|
valid url, an URL key is constructed from the url. Note that this does not
|
|
|
|
register the url as a location of the key; use [[git-annex-registerurl]](1)
|
|
|
|
to do that.
|
|
|
|
|
2015-03-25 16:09:49 +00:00
|
|
|
# OPTIONS
|
|
|
|
|
|
|
|
* `--force`
|
|
|
|
|
|
|
|
Allow making a file link to a key whose content is not in the local
|
2016-12-05 14:59:20 +00:00
|
|
|
repository. The key may not be known to git-annex at all.
|
2015-03-25 16:09:49 +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
|
|
|
* `--batch`
|
|
|
|
|
|
|
|
In batch input mode, lines are read from stdin, and each line
|
|
|
|
should contain a key and filename, separated by a single space.
|
|
|
|
|
|
|
|
* `-z`
|
|
|
|
|
|
|
|
When in batch mode, the input is delimited by nulls instead of the usual
|
|
|
|
newlines.
|
|
|
|
|
|
|
|
(Note that for this to be used, you have to explicitly enable batch mode
|
|
|
|
with `--batch`)
|
|
|
|
|
2019-02-05 18:03:29 +00:00
|
|
|
* `--json`
|
|
|
|
|
|
|
|
Enable JSON output. This is intended to be parsed by programs that use
|
|
|
|
git-annex. Each line of output is a JSON object.
|
|
|
|
|
2021-05-10 19:00:13 +00:00
|
|
|
* Also the [[git-annex-common-options]](1) can be used.
|
|
|
|
|
2015-03-25 16:09:49 +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.
|