Hi,
I just wrote a quick fix for it. That asks for the password. It needs
some testing and magit-password should check if the Enter thing is
really the second line after the "$ git" line.

If you don't want to apply this highly experimental patch and find
yourself in a situation where magit "hangs" because a process is
running. Switch to the process buffer ($) and kill it (C-x k) and
confirm with yes. This should help.

Regards,
Rüdiger <[email protected]>

P.S. magit is really great. I love using it!

Changes in HEAD
        Modified magit.el
diff --git a/magit.el b/magit.el
index bfbfe9b..7c694f5 100644
--- a/magit.el
+++ b/magit.el
@@ -1074,10 +1074,20 @@ Many Magit faces inherit from this one by
default."
     (magit-set-mode-line-process nil)
     (magit-refresh-buffer magit-process-client-buffer)))

+(defun magit-password (proc string)
+  "Checks if git/ssh asks for a password and ask the user for it."
+  (when (string-match "^Enter passphrase for key '\\\(.*\\\)': $"
string)
+    (process-send-string proc
+                         (concat (read-passwd
+                                  (format "Password for '%s':
" (match-string 1 string))
+                                  nil) "\n"))))
+
 (defun magit-process-filter (proc string)
   (save-current-buffer
     (set-buffer (process-buffer proc))
     (let ((inhibit-read-only t))
+      (magit-password proc string)
       (goto-char (process-mark proc))
       ;; Find last ^M in string.  If one was found, ignore everything
       ;; before it and delete the current line.



On Dec 15, 8:01 am, [email protected] (Rémi Vanicat) wrote:
> phtrivier <[email protected]> writes:
> > Hi, i am using magit to interface with a github repository, for which
> > I configured my ssh key.
>
> > When I want to git push to it, I normally have to enter my ssh key
> > passphrase. However when pushing from magit, I don't get prompted for
> > my passphrase.
>
> > I tried displaying the git output (using '$'), and it shows the
> > prompt, but the buffer is read-only and I cannot edit it (I also tried
> > toggling the read-only property, with no success).
>
> > Is it possible to have magit ask for the ssh passphrase in emacs
> > minibuffer ?
>
> It's a bug: we don't tell ssh that it can't ask for passphrase there.
>
> You will found there 
> :http://gitorious.org/~__DL__/magit/remi-magit-clone/commits/ssh-asking
> a patched version that do it better. This need testing (I have change
> the way magit run git, and I believe that it won't change anything, but
> testing will prove it).
>
> It would be probably better to detect the passphrase asking, and to use
> Emacs to ask for it, but this is a more complicated fix. If someone
> could do it, it would be great.
>
> Here is the fixing commit:
>
> commit 213bd29c793b2904b29a01a9c8448e4f9b4c4823
> Author: Rémi Vanicat <[email protected]>
> Date:   Tue Dec 15 07:42:57 2009 +0100
>
>     Use pipe rather than tty for connection with git.
>
>     When remote updating, git may use ssh that may ask for a password or
>     passphrase. ssh used to be on a tty, and so believe that it could ask
>     the passphrase directly to the user. It now know that it can't, and
>     will ssh-askpass (if available) to do the asking.
>
>     It would be probably better to detect the passphrase asking, and to
>     use Emacs to ask for it.
>
> diff --git a/magit.el b/magit.el
> index bfbfe9b..a035ebe 100644
> --- a/magit.el
> +++ b/magit.el
> @@ -1004,7 +1004,8 @@ Many Magit faces inherit from this one by default."
>         (args (cdr cmd-and-args))
>         (dir default-directory)
>         (buf (get-buffer-create "*magit-process*"))
> -       (successp nil))
> +       (successp nil)
> +       (process-connection-type nil))
>      (magit-set-mode-line-process
>       (magit-process-indicator-from-command cmd-and-args))
>      (setq magit-process-client-buffer (current-buffer))
>
> --
> Rémi Vanicat

Reply via email to