From: Hong Xu Date: Thu, 22 Mar 2012 12:48:56 GMT Subject: Re: [BUG] git bash-completion is incorrect for "git pull origin mas" if the ssh key is encrypted Message-ID: <03324BD2-116A-42EF-AB18-38F4A30A1115@gmail.com> In-Reply-To: <4F6B16BE.1050003@viscovery.net> On Mar 22, 2012, at 20:10, Johannes Sixt wrote: > Am 3/22/2012 11:28, schrieb Zbigniew Jędrzejewski-Szmek: >> On 03/22/2012 07:04 AM, Hong Xu wrote: >>> Hello everyone, >>> >>> If my ssh key is encrypted, "git pull origin mas" will give a >>> unexpected result, something like this: >>> >>> git pull origin masEnter passphrase for key '/home/user/.ssh/id_rsa': >>> >>> I know maybe it is not possible to complete the "master", but maybe it >>> is better to not complete anything than append something like that? >> It is ssh itself which emits this message. The completion script calls >> 'git ls-remote origin', which in turn invokes ssh. Typing the password in >> actually works, but I understand that you are annoyed by the message. >> >> I don't think there's an easy way to silence this in git completion, >> without affecting other times when the key would be requested. E.g. we >> would want ssh to ask for the key while doing 'git pull', but not when run >> automatically during completion. >> >> Maybe git-ls-remote should learn --quiet? > > No. IMHO, bash completion stretches too far by asking the remote for the > refs that it has. > I agree with this rather than using silent mode. If a encrypted key is found, I think we better drop the completion. I don't know whether there is a way to implement this yet, at least we can try to find it. Hong