From 3286bebf998700d79ab766472cebfcc4399c8894 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Mar 2017 16:02:47 -0400 Subject: Support GIT_SSH and GIT_SSH_COMMAND They are handled close the same as they are by git. However, unlike git, git-annex sometimes needs to pass the -n parameter when using these. So, this has the potential for breaking some setup, and perhaps there ought to be a ANNEX_USE_GIT_SSH=1 needed to use these. But I'd rather avoid that if possible, so let's see if anyone complains. Almost all places where "ssh" was run have been changed to support the env vars. Anything still calling sshOptions does not support them. In particular, rsync special remotes don't. Seems that annex-rsync-transport already gives sufficient control there. (Fixed in passing: Remote.Helper.Ssh.toRepo used to extract remoteAnnexSshOptions and pass them to sshOptions, which was redundant since sshOptions also extracts those.) This commit was sponsored by Jeff Goeke-Smith on Patreon. --- doc/git-annex.mdwn | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'doc/git-annex.mdwn') diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index e38d31eaa..0add5a537 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -1404,6 +1404,37 @@ specific failures. git-annex itself should return 0 on success and 1 on failure, unless the `--time-limit=time` option is hit, in which case it returns with exit code 101. +# ENVIRONMENT + +These environment variables are used by git-annex when set: + +* `GIT_WORK_TREE`, `GIT_DIR` + + Handled the same as they are by git, see git(1) + +* `GIT_SSH`, `GIT_SSH_COMMAND` + + Handled similarly to the same as described in git(1). + The one difference is that git-annex will sometimes pass an additional + "-n" parameter to these, as the first parameter, to prevent ssh from + reading from stdin. + + Note that setting either of these environment variables prevents + git-annex from automatically enabling ssh connection caching + (see `annex.sshcaching`), so it will slow down some operations with + remotes over ssh. It's up to you to enable ssh connection caching + if you need it; see ssh's documentation. + + Also, `annex.ssh-options` and `remote..annex-ssh-options` + won't have any effect when these envionment variables are set. + + Usually it's better to configure any desired options through your + ~/.ssh/config file, or by setting `annex.ssh-options`. + +Some special remotes use additional environment variables +for authentication etc. For example, `AWS_ACCESS_KEY_ID` +and `GIT_ANNEX_P2P_AUTHTOKEN`. See special remote documentation. + # FILES These files are used by git-annex: -- cgit v1.2.3