{"thread":{"id":"22500","subject":"http getpass function in msysgit","startedAt":"2010-02-03T03:18:23Z","lastAt":"2010-02-04T02:32:10Z","messageCount":6,"participants":["Frank Li","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133441","messageId":"1976ea661002021918m19d9b37fx1872557d3c810e3a@mail.gmail.com","threadId":"22500","inReplyTo":null,"subject":"http getpass function in msysgit","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2010-02-03T03:18:23Z","receivedAt":"2010-02-03T03:18:23Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":"ALL:\n\n        getpass at mingw.c is direct read character with function _getch().\n        GUI application, such tortoisegit will halt when http need\npassword input because gui don't know git wait for inputing passwords.\n\n        To resolve this problem, I have two options.\n        Options 1:\n                Check if terminal is exist, if exist, using old\nmethod. Otherwise launch internal password dialog.\n\n        Options 2:\n                like openSSH,  Check if terminal is not exist and\nenvironment HTTP_ASKPASS exist, if true, run application which\nHTTP_ASKPASS point, otherwise using old ways.\n\n       Which one do you prefer,  I can implement it.\n\nbest regards\nFrank Li\n"},{"id":"133442","messageId":"7vpr4mrijt.fsf@alter.siamese.dyndns.org","threadId":"22500","inReplyTo":"1976ea661002021918m19d9b37fx1872557d3c810e3a@mail.gmail.com","subject":"Re: http getpass function in msysgit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-03T05:32:06Z","receivedAt":"2010-02-03T05:32:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Li <lznuaa@gmail.com> writes:\n\n>         getpass at mingw.c is direct read character with function _getch().\n>         GUI application, such tortoisegit will halt when http need\n> password input because gui don't know git wait for inputing passwords.\n>\n>         To resolve this problem, I have two options.\n>         Options 1:\n>                 Check if terminal is exist, if exist, using old\n> method. Otherwise launch internal password dialog.\n>\n>         Options 2:\n>                 like openSSH,  Check if terminal is not exist and\n> environment HTTP_ASKPASS exist, if true, run application which\n> HTTP_ASKPASS point, otherwise using old ways.\n>\n>        Which one do you prefer,  I can implement it.\n\nIs \"Neither, at least not yet\" an accepted answer?\n\n - If you look at an environment, why check terminal at all?  If the\n   calling application wants to specify \"here is the way to ask the user\n   for a password\" with it, why not use it unconditionally?\n\n - Why is it HTTP_ASKPASS?  If other codepaths (e.g. \"ssh passphrase\",\n   \"svn password\") that do not have anything to do with HTTP transfer also\n   wants that feature, wouldn't it be easier for the users to specify one\n   single \"password dialog\" helper program, that is launched by various\n   parts of git, and ask \"I need the HTTP password to access li.org\", \"I\n   need to unlock the ssh key for fl@li.org\", etc?\n"},{"id":"133443","messageId":"1976ea661002022148s544be10bie912295e04189864@mail.gmail.com","threadId":"22500","inReplyTo":"7vpr4mrijt.fsf@alter.siamese.dyndns.org","subject":"Re: http getpass function in msysgit","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2010-02-03T05:48:26Z","receivedAt":"2010-02-03T05:48:26Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":">  - If you look at an environment, why check terminal at all?  If the\n>   calling application wants to specify \"here is the way to ask the user\n>   for a password\" with it, why not use it unconditionally?\n\nI just worry about user set such environment accident. Learn it from  OpenSSH.\nUnconditional is okay for me.\n\n>\n>  - Why is it HTTP_ASKPASS?  If other codepaths (e.g. \"ssh passphrase\",\n>   \"svn password\") that do not have anything to do with HTTP transfer also\n>   wants that feature,\n\nYou can choose environment name you like. I choose HTTP_ASKPASS just\nbecause getpass only used at http.c\nssl_cert_password = getpass(\"Certificate Password: \");\n\nOpenSSH is separated application and use own SSH_ASKPASS to ask password ...\n\nMay GIT_ASKPASS is optional name.\n\n>  wouldn't it be easier for the users to specify one\n>   single \"password dialog\" helper program, that is launched by various\n>   parts of git, and ask \"I need the HTTP password to access li.org\", \"I\n>   need to unlock the ssh key for fl@li.org\", etc?\n\nIt is nice to use one dialog for all cases. git-svn also have the same problem.\n"},{"id":"133560","messageId":"7vaavp3i2n.fsf@alter.siamese.dyndns.org","threadId":"22500","inReplyTo":"1976ea661002022148s544be10bie912295e04189864@mail.gmail.com","subject":"Re: http getpass function in msysgit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-04T01:28:32Z","receivedAt":"2010-02-04T01:28:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Li <lznuaa@gmail.com> writes:\n\n> You can choose environment name you like. I choose HTTP_ASKPASS just\n> because getpass only used at http.c\n> ssl_cert_password = getpass(\"Certificate Password: \");\n>\n> OpenSSH is separated application and use own SSH_ASKPASS to ask password ...\n>\n> May GIT_ASKPASS is optional name.\n\nIf that is the case, probably it is easiest for the end users if you\narrange it this way:\n\n - If GIT_ASKPASS is not set:\n\n   - If SSH_ASKPASS is present, then use that from getpass() for any and\n     all places that would want to get \"password\" like things;\n\n   - Otherwise consult the terminal as before;\n\n - If GIT_ASKPASS is set:\n\n   - If SSH_ASKPASS is not set, then export the value of GIT_ASKPASS as\n     such as well, so that whenever we spawn \"ssh\", the same GIT_ASKPASS\n     program will be used as a fallback.\n\nThat way, if the user already has set up SSH_ASKPASS, we will use the same\nfamiliar dialog without forcing the user do anything extra.  If the user\nonly sets GIT_ASKPASS without doing SSH_ASKPASS, we would also use it to\ndrive the ssh session.  In either case, the user doesn't need to worry\nabout multiple configuration or dialog interface.\n\n> It is nice to use one dialog for all cases. git-svn also have the same problem.\n\nPeople often seem to use \"/usr/lib{,exec}/openssh/gnome-ssh-askpass\" as\nSSH_ASKPASS.  It takes the prompt from its command line argument, reads\nthe input, and spits it out to its standard output so that calling program\ncan capture it.  It would be a good interface to conform to to minimize\nthe work we need to support this.\n"},{"id":"133566","messageId":"1976ea661002031756j2c2699b0hf7deb8febdce841b@mail.gmail.com","threadId":"22500","inReplyTo":"7vaavp3i2n.fsf@alter.siamese.dyndns.org","subject":"Re: http getpass function in msysgit","fromName":"Frank Li","fromEmail":"lznuaa@gmail.com","sentAt":"2010-02-04T01:56:57Z","receivedAt":"2010-02-04T01:56:57Z","isPatch":false,"sender":{"key":"lznuaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40642?v=4"},"body":">\n>  - If GIT_ASKPASS is not set:\n>\n>   - If SSH_ASKPASS is present, then use that from getpass() for any and\n>     all places that would want to get \"password\" like things;\n>\n>   - Otherwise consult the terminal as before;\n>\n>  - If GIT_ASKPASS is set:\n>\n>   - If SSH_ASKPASS is not set, then export the value of GIT_ASKPASS as\n>     such as well, so that whenever we spawn \"ssh\", the same GIT_ASKPASS\n>     program will be used as a fallback.\n>\n> That way, if the user already has set up SSH_ASKPASS, we will use the same\n> familiar dialog without forcing the user do anything extra.  If the user\n> only sets GIT_ASKPASS without doing SSH_ASKPASS, we would also use it to\n> drive the ssh session.  In either case, the user doesn't need to worry\n> about multiple configuration or dialog interface.\n>\n>> It is nice to use one dialog for all cases. git-svn also have the same problem.\n>\n\nCan we direct use SSH_ASKPASS for all getpass and don't use GIT_ASKPASS at all?\nThe logic will be come simple.\n"},{"id":"133575","messageId":"7vfx5hybmd.fsf@alter.siamese.dyndns.org","threadId":"22500","inReplyTo":"1976ea661002031756j2c2699b0hf7deb8febdce841b@mail.gmail.com","subject":"Re: http getpass function in msysgit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-04T02:32:10Z","receivedAt":"2010-02-04T02:32:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Frank Li <lznuaa@gmail.com> writes:\n\n> Can we direct use SSH_ASKPASS for all getpass and don't use GIT_ASKPASS at all?\n> The logic will be come simple.\n\nIf you _really_ have to ask me,...\n\nI'd suspect people would feel it funny if the only advertised interface\nwere SSH_*, especially when they don't use OpenSSH at all and setting up\nthe prompter solely to use git over http.  If you use GIT_ASKPASS as the\nadvertised _primary_ interface to drive the prompter, while falling back\non SSH_ASKPASS as a mere end-user convenience measure, you wouldn't have\nthat problem.  Hence my suggestion.\n\nBut in the end it's up to you to decide.  I won't be writing this code\n;-).\n"}]}