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

Re: [PATCH 2/2] Allow core.askpass to override SSH_ASKPASS.

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 27, 2010, 17:28 UTC
Message-ID
<7v4oeghsms.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201008271445.26098.k.franke@science-computing.de>
Knut Franke <k.franke@science-computing.de> writes:
Show 14 quoted lines
>> > diff --git a/connect.c b/connect.c
>> > index e296bfc..f97b84c 100644
>> > --- a/connect.c
>> > +++ b/connect.c
>> > @@ -627,9 +627,13 @@ char *git_getpass(const char *prompt)
>> >        static struct strbuf buffer = STRBUF_INIT;
>> >
>> >        askpass = getenv("GIT_ASKPASS");
>> > +
>>
>> Why?
>
> Considering the check for SSH_ASKPASS added below, I believe this improves 
> legibilty since all of the "if (!askpass..." blocks are similar in intention.

I think Erik is asking about the extra blank line. You could have achieved the same consistency by removing, no?

diff --git a/connect.c b/connect.c
index e296bfc..f97b84c 100644
--- a/connect.c
+++ b/connect.c
@@ -627,9 +627,10 @@ char *git_getpass(const char *prompt)
 	static struct strbuf buffer = STRBUF_INIT;
 
 	askpass = getenv("GIT_ASKPASS");
 	if (!askpass)
 		askpass = askpass_program;
-
+	if (!askpass)
+		askpass = getenv("SSH_ASKPASS");
 	if (!askpass || !(*askpass))
 		return getpass(prompt);
 
Previous: Knut Franke
Message 4 of 4 in “Allow core.askpass to override SSH_ASKPASS.”
  1. 2/2 Allow core.askpass to override SSH_ASKPASS.Knut Franke, Aug 27, 2010
  2. Erik Faye-LundAug 27, 2010
  3. Knut FrankeAug 27, 2010
  4. Junio C HamanoAug 27, 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.