diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-03-17 16:02:47 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-03-17 16:20:37 -0400 |
commit | 3286bebf998700d79ab766472cebfcc4399c8894 (patch) | |
tree | d2e9270d407c291621042fe5d70b75561b96ec9a /doc | |
parent | acc7effc35e2552809df830c4a8213771168c724 (diff) |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/forum/GIT__95__SSH/comment_1_c2e827eeac7524845cad42671d77af95._comment | 14 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 31 |
2 files changed, 45 insertions, 0 deletions
diff --git a/doc/forum/GIT__95__SSH/comment_1_c2e827eeac7524845cad42671d77af95._comment b/doc/forum/GIT__95__SSH/comment_1_c2e827eeac7524845cad42671d77af95._comment new file mode 100644 index 000000000..baced499e --- /dev/null +++ b/doc/forum/GIT__95__SSH/comment_1_c2e827eeac7524845cad42671d77af95._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-03-17T17:26:56Z" + content=""" +I've added support for this now. + +However, since git's interface to this doesn't let any options other than +-p be passed to the command run by this, git-annex can't either. Which +means it can't pass options for ssh connection caching. So, I'm afraid that +using `GIT_SSH` will slow things down somewhat. Of course, you can always +enable ssh connection caching yourself in either the `GIT_SSH` script or +the ssh configuration. +"""]] 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.<name>.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: |