git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] git_connect: set ssh shell command in GIT_SSH_COMMAND

From
Jeff King <peff@peff.net>
Date
Nov 10, 2014, 07:11 UTC
Message-ID
<20141110071154.GD7677@peff.net>
In-Reply-To
<20141109224231.GA59064@melamine.cuivre.fr.eu.org>
On Sun, Nov 09, 2014 at 11:42:32PM +0100, Thomas Quinot wrote:
Show 19 quoted lines
> It may be impractical to install a wrapper script for GIT_SSH
> when additional parameters need to be passed. Provide an alternative
> way of specifying a shell command to be run, including command line
> arguments, by means of the GIT_SSH_COMMAND environment variable,
> which behaves like GIT_SSH but is passed to the shell.
> 
> The special circuitry to modify parameters in the case of using
> PuTTY's plink/tortoiseplink is activated only when using GIT_SSH;
> in the case of using GIT_SSH_COMMAND, it is deliberately left up to
> the user to make any required parameters adaptation before calling
> the underlying ssh implementation.
> 
> Signed-off-by: Thomas Quinot <thomas@quinot.org>
> ---
> 
> Amended patch as per discussion with Junio: change variable name
> to GIT_SSH_COMMAND, keep plink special circuitry disabled for
> this case (leaving it enabled only when using GIT_SSH, thus
> preserving compatibility with legacy usage).
I think this version looks good. Thanks for working on it.

Two style micro-nits (that I do not think even merit a re-roll by themselves, but Junio may want to mark up as he applies):

> +			} else {
> +				ssh = getenv("GIT_SSH");
> +				if (!ssh) ssh = "ssh";

You did not even introduce this line, but only reindented it. However, our code style usually would write this as:

	if (!ssh)
		ssh = "ssh";
> +				putty = strcasestr(ssh, "plink") != NULL;
We would usually write this as:
	putty = !!strcasestr(ssh, "plink");
-Peff
Previous: Thomas QuinotNext: Thomas Quinot
Message 12 of 15 in “git_connect: allow passing arguments to ssh in GIT_SSH_ARGS”
  1. git_connect: allow passing arguments to ssh in GIT_SSH_ARGSThomas Quinot, Nov 8, 2014
  2. Jeff KingNov 8, 2014
  3. Thomas QuinotNov 8, 2014
  4. 1/2 git_connect: set ssh shell command in GIT_SSH_CMDThomas Quinot, Nov 8, 2014
  5. Jeff KingNov 9, 2014
  6. Thomas QuinotNov 9, 2014
  7. git_connect: set ssh shell command in GIT_SSH_CMDThomas Quinot, Nov 9, 2014
  8. Junio C HamanoNov 9, 2014
  9. Thomas QuinotNov 9, 2014
  10. Junio C HamanoNov 9, 2014
  11. git_connect: set ssh shell command in GIT_SSH_COMMANDThomas Quinot, Nov 9, 2014
  12. Jeff KingNov 10, 2014
  13. Thomas QuinotNov 10, 2014
  14. Junio C HamanoNov 10, 2014
  15. 2/2 git_connect: when using GIT_SSH_CMD, check for plink in argv[0] onlyThomas Quinot, Nov 8, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.