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

Re: [PATCH v2 1/3] git-svn: Support retrieving passwords with GIT_ASKPASS

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 26, 2010, 06:33 UTC
Message-ID
<7vzl2wa4m0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1267142845-3040-1-git-send-email-lznuaa@gmail.com>
Frank Li <lznuaa@gmail.com> writes:
Show 9 quoted lines
> +if (! exists $ENV{GIT_ASKPASS}) {
> +	if (exists $ENV{SSH_ASKPASS}) {
> +		$ENV{GIT_ASKPASS} = $ENV{SSH_ASKPASS};
> +		if ($^O eq 'msys') {
> +                        $ENV{GIT_ASKPASS} =~ s/\\/\\\\/g;
> +                        $ENV{GIT_ASKPASS} =~ s/(.*)/"$1"/;
> +                }
> +	}
> +}

I've seen this code before, and you may not be the best person to answer this question, but this worries me and puzzles me a bit.

On msys (and nowhere else), SSH_ASKPASS can be used as given by the user to launch the prompter, but GIT_ASKPASS must be quoted in some funny way.

Why is that? Does this mean they must be given differently by the end user? In other words, if the end user wants to set GIT_ASKPASS himself, s/he needs to do this funny quoting, that is different from SSH_ASKPASS.

I also notice that git-gui has support for SSH_ASKPASS (and its own implementation). Does it have the same quoting issues on msys?

The reason I am asking is because:
 (1) if SSH_ASKPASS and GIT_ASKPASS cannot be specified exactly the same
     way, then [PATCH 3/3] would probably need a similar quoting magic?
 (2) With [PATCH 3/3], with quoting magic if necessary, we wouldn't need
     the above hunk, as it has already be done by the "git" potty.
Previous: Frank LiNext: Frank Li
Message 2 of 5 in “git-svn: Support retrieving passwords with GIT_ASKPASS”
  1. 1/3 git-svn: Support retrieving passwords with GIT_ASKPASSFrank Li, Feb 26, 2010
  2. Junio C HamanoFeb 26, 2010
  3. Frank LiFeb 26, 2010
  4. Eric WongFeb 26, 2010
  5. Johannes SixtFeb 26, 2010

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.