Closed dmusican closed 6 years ago
This was tricky at first for me to repeat reliably. It seems to be happening when my .ssh/config file has an entry for the host that is acting as remote, and when I have an IdentityFile line. In that case, the password prompt appears over and over. If I remove that line (and thus use a default id_rsa file, for example), it works fine.
Two fixes need to happen here. One is that with the above fault in, Elegit needs to give better information on what's going wrong. The second thing is to figure out why it's failing. Is it a Jsch bug?
There seem to be two simultaneous problems going on. One is that JGit/JSch is not remembering the passphrase; the prompt keeps coming back every time the RepositoryMonitor kicks in. The second problem is that if the passphrase prompt is still up when RepositoryMonitor tries again, the previous operation is interrupted, resulting in an InterruptedException getting thrown.
So, to resummarize, the following fixes need to be made and tested:
When ElegitUserInfoGUI is waiting for a prompt, and the task has been interrupted, this needs to be handled gracefully by closing the dialog.
RespositoryMonitor shouldn't be re-prompting for the passphrase. It doesn't do this in the case of the default id_rsa, so keep it from doing this anywhere.
When a password works, post to the notification window (not with a popup) that it did so.
Item "1" above is complete. Dialog hides as it should, and a notification for the user is shown.
For "2" above: this is a JGit bug, which has been fixed in nightly updates. So I'll create a test to test this bug, then catch the update to see if it will help.
"2" is complete. I've upgraded to JGit 4.11.0-SNAPSHOT, which is the current development in-progress version of 4.11 which has the fix to the above mentioned bug. I am now subscribing to the JGit developers email list, and so plan to upgrade JGit to 4.11.0 release when it comes out.
For "3": I'm going to not bother with this, since the "Connected to remote" checkmark should serve this purpose.
You should only have to enter the password in once, but it keeps coming up, over and over. I suspect that's RepositoryMonitor, and isn't remembering the password.