* Re: [msysGit] git-svn.perl should check GIT_ASKPASS environment [not found] <1c47e93c-5b7c-4aed-8a78-807d3aff2700@n36g2000pre.googlegroups.com> @ 2011-02-11 9:25 ` Erik Faye-Lund 2011-02-11 9:37 ` Frank Li 0 siblings, 1 reply; 4+ messages in thread From: Erik Faye-Lund @ 2011-02-11 9:25 UTC (permalink / raw) To: Jose Roberto Garcia Chico; +Cc: msysGit, Git Mailing List, Eric Wong On Fri, Feb 11, 2011 at 9:17 AM, Jose Roberto Garcia Chico <jose@toro-asia.com> wrote: > 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? "; ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [msysGit] git-svn.perl should check GIT_ASKPASS environment 2011-02-11 9:25 ` [msysGit] git-svn.perl should check GIT_ASKPASS environment Erik Faye-Lund @ 2011-02-11 9:37 ` Frank Li 2011-02-11 10:28 ` Erik Faye-Lund 0 siblings, 1 reply; 4+ messages in thread From: Frank Li @ 2011-02-11 9:37 UTC (permalink / raw) To: kusmabite; +Cc: Jose Roberto Garcia Chico, msysGit, Git Mailing List, Eric Wong > 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? > SSH_ASKPASS is used to accept "Enter your OpenSSH passphrase". refer to git-gui/git-gui--askpass GIT_ASKPASS should be similar with SSH_ASKPASS. git-svn can use GIT_ASKPASS hook to launch third part application to accept certification. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [msysGit] git-svn.perl should check GIT_ASKPASS environment 2011-02-11 9:37 ` Frank Li @ 2011-02-11 10:28 ` Erik Faye-Lund 2011-02-11 11:34 ` Frank Li 0 siblings, 1 reply; 4+ messages in thread From: Erik Faye-Lund @ 2011-02-11 10:28 UTC (permalink / raw) To: Frank Li; +Cc: Jose Roberto Garcia Chico, msysGit, Git Mailing List, Eric Wong On Fri, Feb 11, 2011 at 10:37 AM, Frank Li <lznuaa@gmail.com> wrote: >> 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? >> > > SSH_ASKPASS is used to accept "Enter your OpenSSH passphrase". > refer to git-gui/git-gui--askpass > git-gui--askpass can ask for a password, or yes/no questions. But this is neither, it's a reject/accept temporary/accept permanently question. Perhaps the prompt could be rewritten as two yes/no questions, though? Something like "Accept certificate? (yes/no)" and if the answer is "yes", query with something like "Store certificate? (yes/no)". Dunno... ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [msysGit] git-svn.perl should check GIT_ASKPASS environment 2011-02-11 10:28 ` Erik Faye-Lund @ 2011-02-11 11:34 ` Frank Li 0 siblings, 0 replies; 4+ messages in thread From: Frank Li @ 2011-02-11 11:34 UTC (permalink / raw) To: kusmabite; +Cc: Jose Roberto Garcia Chico, msysGit, Git Mailing List, Eric Wong >> SSH_ASKPASS is used to accept "Enter your OpenSSH passphrase". >> refer to git-gui/git-gui--askpass >> > > git-gui--askpass can ask for a password, or yes/no questions. But this > is neither, it's a reject/accept temporary/accept permanently > question. > > Perhaps the prompt could be rewritten as two yes/no questions, though? > Something like "Accept certificate? (yes/no)" and if the answer is > "yes", query with something like "Store certificate? (yes/no)". I think that's fine. Frank Li ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-11 11:40 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1c47e93c-5b7c-4aed-8a78-807d3aff2700@n36g2000pre.googlegroups.com> 2011-02-11 9:25 ` [msysGit] git-svn.perl should check GIT_ASKPASS environment Erik Faye-Lund 2011-02-11 9:37 ` Frank Li 2011-02-11 10:28 ` Erik Faye-Lund 2011-02-11 11:34 ` Frank Li
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).