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

Re: [PATCH 3/3] fallback SSH_ASKPASS when GIT_ASKPASS not set

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 24, 2010, 16:24 UTC
Message-ID
<7vocje38ll.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1267024554-3288-1-git-send-email-lznuaa@gmail.com>
Frank Li <lznuaa@gmail.com> writes:
> If GIT_ASKPASS is not set and SSH_ASKPASS set, GIT_ASKPASS will
> use SSH_ASKPASS. If GIT_ASKPASS set and SSH_ASKPASS is not set,
> SSH_ASKPASS will use GIT_ASKPASS.
If both are set and to different values, what should happen?

I think the basic idea is sound, but I am not sure if we should fallback on both ways. If both GIT_ASKPASS and SSH_ASKPASS are set, the user is probably telling us to use GIT_ASKPASS when git does something, similar to how GIT_EDITOR and EDITOR interacts.

So probably the patch to implement the fallback should be more like
	if (SSH_ASKPASS is set but not GIT_ASKPASS)
        	set GIT_ASKPASS from SSH_ASKPASS
and then the password prompter should use GIT_ASKPASS exclusively.

Of course, when we _do_ spawn ssh ourselves internally in connect.c, we may have to export the value of GIT_ASKPASS as SSH_ASKPASS at the call site to honor the user's request to use GIT_ASKPASS while in git (that is part of "use GIT_ASKPASS exclusively").

But it feels wrong if we exported SSH_ASKPASS set from GIT_ASKPASS when spawning processes in other codepaths, especially if SSH_ASKPASS is set (or unset) differently from GIT_ASKPASS.

Shawn is CC'ed as git-gui currently honors only SSH_ASKPASS and this patch changes the behaviour slightly.

Previous: Frank LiNext: Frank Li
Message 4 of 5 in “fallback SSH_ASKPASS when GIT_ASKPASS not set”
  1. 3/3 fallback SSH_ASKPASS when GIT_ASKPASS not setFrank Li, Feb 24, 2010
  2. Erik Faye-LundFeb 24, 2010
  3. Frank LiFeb 25, 2010
  4. Junio C HamanoFeb 24, 2010
  5. Frank LiFeb 25, 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.