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

Re: [msysGit] git-svn.perl should check GIT_ASKPASS environment

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Feb 11, 2011, 09:25 UTC
Message-ID
<AANLkTinkv0dNxNxehud0Byuu9tpqxp1kBMJ1OyEcfVQ_@mail.gmail.com>
In-Reply-To
<1c47e93c-5b7c-4aed-8a78-807d3aff2700@n36g2000pre.googlegroups.com>

On Fri, Feb 11, 2011 at 9:17 AM, Jose Roberto Garcia Chico <jose@toro-asia.com> wrote:

Show 15 quoted lines
> git-svn.perl problem.
>
> prompt:
>        print STDERR $may_save ?
>              "(R)eject, accept (t)emporarily or accept (p)ermanently? " :
>              "(R)eject or accept (t)emporarily? ";
>        STDERR->flush;
>        $choice = lc(substr(<STDIN> || 'R', 0, 1));
>
> should check GIT_ASKPASS environment.
>
> For further information
>
> http://code.google.com/p/tortoisegit/issues/detail?id=706
>

As was already said in the thread you're linking to, this isn't a Windows-specific git-issue. CC'ing the main Git mailing list, where this discussion belongs.

But I don't think it should check GIT_ASKPASS, GIT_ASKPASS isn't a general-purpose dialog-box hook, it's a hook for getting *passwords*. To allow git-svn to query the user of a non-terminal user, another mechanism would probably be created. But in any case, I we should do something other than just waiting if we're not connected to a TTY. I don't really know Perl that well, but perhaps something like this does the trick?

diff --git a/git-svn.perl b/git-svn.perl
index 177dd25..24f3486 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3964,6 +3964,9 @@ sub ssl_server_trust {
 	                               issuer_dname fingerprint);
 	my $choice;
 prompt:
+	if (!-t STDERR || !-t STDIN) {
+		return -1;
+	}
 	print STDERR $may_save ?
 	      "(R)eject, accept (t)emporarily or accept (p)ermanently? " :
 	      "(R)eject or accept (t)emporarily? ";
Next: Frank Li
Message 1 of 4 in “Re: [msysGit] git-svn.perl should check GIT_ASKPASS environment”
  1. Erik Faye-LundFeb 11, 2011
  2. Frank LiFeb 11, 2011
  3. Erik Faye-LundFeb 11, 2011
  4. Frank LiFeb 11, 2011

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.