Re: [PATCH] Use SSH key from `GIT_SSH_KEY` variable if supplied

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Maciej Małecki <me@xxxxxxxxxxxx> 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".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]