When a custom transfer adapter is specified in the configuration, it is
not possible to specify multiple arguments to the process, because only
the last value of the lfs.customtransfer.*.args option is read and the
value is not split. To make things easier and more flexible,
concatenate the path (after quoting) and the arguments and pass them to
the shell. Update the documentation to reflect this change.
Update the test custom transfer adapter to parse its arguments (which
are otherwise ignored) and mention them to standard error. Make the
test check that the arguments are parsed as the shell would expect them
to be.
PR-2429 has implemented a mechanism to unconditionally specify
standalone custom transfer agents.
This commit extends the mechanism to specify custom transfer agents
based on an URL prefix match on the API URL.
Together with the previous commit, which added the Git remote to the
custom transfer stage 1 initiation message, standalone custom transfer
can now be configured per remote. One remote can, for example, use
Rsync transfer to an SSH server. Another remote can use standard LFS to
GitHub. Example Git config:
```
remote.github.url=...
remote.origin.url=ssh://gitssh.example.com/git/some/repo
lfs.customtransfer.rsync.path=git-lfs-rsync-agent
lfs.https://gitssh.example.com/git/.standalonetransferagent=rsync
```
The config assumes that `git-lfs-rsync-agent` determines the remote from
the stage 1 init message and then inspecting `remote.origin.url` to
infer the rsync host. <https://github.com/aleb/git-lfs-rsync-agent>,
2017-09-17, does not yet do that.
[PR-2429] 09b7c5381bc3fa4ba7ca3564681a5ae5b7e6f3dc 'Allow using custom transfer agents directly', <https://github.com/git-lfs/git-lfs/pull/2429>.
CC: Alexandru Băluț <ab@daedalean.ai>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
git-lfs now passes the Git remote in the stage 1 initiation message.
A standalone custom transfer agent can use it to determine the remote
file location.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Some custom transfer agents figure out everything by themselves and don't need
any authentication or transfer details from the API server.
Added the `lfs.standalonetransferagent` config option for specifying which
custom agent should be used directly.