From: Junio C Hamano <gitster@pobox.com>
To: "Maciej Małecki" <me@mmalecki.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Use SSH key from `GIT_SSH_KEY` variable if supplied
Date: Mon, 19 Mar 2012 18:55:06 -0700 [thread overview]
Message-ID: <7vhaxk829x.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1332207557-10965-1-git-send-email-me@mmalecki.com> ("Maciej Małecki"'s message of "Tue, 20 Mar 2012 02:39:17 +0100")
Maciej Małecki <me@mmalecki.com> writes:
> if (protocol == PROTO_SSH) {
> + const char *key;
> const char *ssh = getenv("GIT_SSH");
> int putty = ssh && strcasestr(ssh, "plink");
> if (!ssh) ssh = "ssh";
> @@ -589,6 +590,13 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
> *arg++ = putty ? "-P" : "-p";
> *arg++ = port;
> }
> +
> + key = getenv("GIT_SSH_KEY");
> + if (key) {
> + *arg++ = "-i";
> + *arg++ = key;
> + }
Hmm. I am somewhat torn.
The minimalist in me finds this extraneous and unnecessary noise. Why
should the user always set GIT_SSH_KEY environment variable that only
applies to git and does not help his other ssh sessions? Why isn't having
an entry in .ssh/config to name IdentityFile sufficient?
On the other hand, the feature-creepist in me finds this somewhat lacking.
Why should we give special treatment only to "-i $identity_file" option
[*1*] and not others? Do we have to invent new environment variables if
we wanted to pass "-c $cipher_spec", "-l $login_name", "-I $pkcs11", "-4",
"-6", or "-b $bind_address"?
Would GIT_SSH_ARGS='-i /home/me/.ssh/there.pub -l me' be more appropriate?
[Footnote]
*1* In any case, GIT_SSH_KEY is misnamed. It should match whatever word
ssh(1) uses to describe the concept--in this case, it is "identity file".
next prev parent reply other threads:[~2012-03-20 1:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 1:39 [PATCH] Use SSH key from `GIT_SSH_KEY` variable if supplied Maciej Małecki
2012-03-20 1:55 ` Junio C Hamano [this message]
2012-03-20 2:07 ` Robin H. Johnson
2012-03-20 8:07 ` Maciej Małecki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vhaxk829x.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=me@mmalecki.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox