dmusican / Elegit

A GUI client for people who want to learn Git.
MIT License
30 stars 7 forks source link

When opening an ssh repo with a password on the private key, the password dialog keeps popping up #559

Closed dmusican closed 6 years ago

dmusican commented 6 years ago

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.

dmusican commented 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?

dmusican commented 6 years ago

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:

  1. When ElegitUserInfoGUI is waiting for a prompt, and the task has been interrupted, this needs to be handled gracefully by closing the dialog.

  2. 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.

  3. When a password works, post to the notification window (not with a popup) that it did so.

dmusican commented 6 years ago

Item "1" above is complete. Dialog hides as it should, and a notification for the user is shown.

dmusican commented 6 years ago

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.

dmusican commented 6 years ago

"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.

dmusican commented 6 years ago

For "3": I'm going to not bother with this, since the "Connected to remote" checkmark should serve this purpose.