Merge pull request #12257 from boblail/allow-configuring-ssh-config

Add HOMEBREW_SSH_CONFIG_PATH
This commit is contained in:
Mike McQuaid 2021-10-20 09:25:43 +01:00 committed by GitHub
commit 86367158ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 1 deletions

View File

@ -794,6 +794,12 @@ fi
source "${HOMEBREW_LIBRARY}/Homebrew/utils/analytics.sh"
setup-analytics
# Use this configuration file instead of ~/.ssh/config when fetching git over SSH.
if [[ -n "${HOMEBREW_SSH_CONFIG_PATH}" ]]
then
export GIT_SSH_COMMAND="ssh -F${HOMEBREW_SSH_CONFIG_PATH}"
fi
if [[ -n "${HOMEBREW_BASH_COMMAND}" ]]
then
# source rather than executing directly to ensure the entire file is read into

View File

@ -455,7 +455,7 @@ EOS
fi
export GIT_TERMINAL_PROMPT="0"
export GIT_SSH_COMMAND="ssh -oBatchMode=yes"
export GIT_SSH_COMMAND="${GIT_SSH_COMMAND:-ssh} -oBatchMode=yes"
if [[ -n "${HOMEBREW_GIT_NAME}" ]]
then

View File

@ -282,6 +282,11 @@ module Homebrew
description: "If set, running Homebrew on Linux will use homebrew-core instead of linuxbrew-core.",
boolean: true,
},
HOMEBREW_SSH_CONFIG_PATH: {
description: "If set, Homebrew will use the given config file instead of `~/.ssh/config` when fetching " \
"`git` repos over `ssh`.",
default_text: "`$HOME/.ssh/config`",
},
HOMEBREW_SKIP_OR_LATER_BOTTLES: {
description: "If set along with `HOMEBREW_DEVELOPER`, do not use bottles from older versions " \
"of macOS. This is useful in development on new macOS versions.",

View File

@ -2089,6 +2089,11 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
- `HOMEBREW_FORCE_HOMEBREW_CORE_REPO_ON_LINUX`
<br>If set, running Homebrew on Linux will use homebrew-core instead of linuxbrew-core.
- `HOMEBREW_SSH_CONFIG_PATH`
<br>If set, Homebrew will use the given config file instead of `~/.ssh/config` when fetching `git` repos over `ssh`.
*Default:* `$HOME/.ssh/config`
- `HOMEBREW_SKIP_OR_LATER_BOTTLES`
<br>If set along with `HOMEBREW_DEVELOPER`, do not use bottles from older versions of macOS. This is useful in development on new macOS versions.

View File

@ -3042,6 +3042,15 @@ If set, running Homebrew on Linux will simulate certain macOS code paths\. This
If set, running Homebrew on Linux will use homebrew\-core instead of linuxbrew\-core\.
.
.TP
\fBHOMEBREW_SSH_CONFIG_PATH\fR
.
.br
If set, Homebrew will use the given config file instead of \fB~/\.ssh/config\fR when fetching \fBgit\fR repos over \fBssh\fR\.
.
.IP
\fIDefault:\fR \fB$HOME/\.ssh/config\fR
.
.TP
\fBHOMEBREW_SKIP_OR_LATER_BOTTLES\fR
.
.br