unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Using msysgit and Github and eshell/shell on Windows
@ 2012-06-13  8:08 Bastian Bechtold
  2012-06-13 10:01 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Bastian Bechtold @ 2012-06-13  8:08 UTC (permalink / raw)
  To: emacs-devel

Hi,

I have been using Emacs and git for a while now. It took a bit of tweaking to get it to work right on Windows, but worked really well after that.

Now the problem is, I now have a repository hosted on Github, which requires authentication.

Whenever I run any git command that requires authentication (push, pull, fetch basically), Emacs starts the git process, but it never finishes. If I use the same commands (with the same executables) in different shells such as CMD, powershell, the git shell or the msys shell, git prompts me for my username and password. If I run the same commands in Emacs on OSX, Emacs even prompts me for my possword in the minibuffer! On Windows however, Emacs does not prompt me for my username or password, but apparently still waits for it eternally and the command just never completes.

This happens with eshell, shell and magit on Windows only.

Here is the relevant section of my .emacs file:

(when (eq system-type 'windows-nt)
  (setq magit-git-executable "C:/Program Files (x86)/Git/bin/git.exe")
  ;; so git opens emacs if invoked from emacs
  (setenv "EDITOR" "C:/PROGRA~2/emacs/bin/emacs.exe")
  ;; so eshell uses git.exe instead of git.cmd, which is achingly slow
  (setenv "PATH" (concat "C:\\Program Files (x86)\\Git\\bin;" (getenv "PATH")))
  ;; so shell finds all the msys binaries
  (setenv "PATH" (concat "C:\\MinGW\\msys\\1.0\\bin;" (getenv "PATH")))
  ;; so shell uses the MinGW bash shell
  (setq explicit-shell-file-name "C:/MinGW/msys/1.0/bin/bash")
  ;; so emacs finds the vital binaries like diff.exe
  (add-to-list 'exec-path "C:/MinGW/msys/1.0/bin"))

Any pointers on how to debug this would be greatly appreciated.

Kind regards,
Bastian


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using msysgit and Github and eshell/shell on Windows
  2012-06-13  8:08 Using msysgit and Github and eshell/shell on Windows Bastian Bechtold
@ 2012-06-13 10:01 ` Dmitry Gutov
  2012-07-13 15:36   ` Samuel Bronson
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2012-06-13 10:01 UTC (permalink / raw)
  To: emacs-devel

Hi Bastian,

> Whenever I run any git command that requires authentication (push,
> pull, fetch basically), Emacs starts the git process, but it never
> finishes. If I use the same commands (with the same executables) in
> different shells such as CMD, powershell, the git shell or the msys
> shell, git prompts me for my username and password. If I run the same
> commands in Emacs on OSX, Emacs even prompts me for my possword in the
> minibuffer! On Windows however, Emacs does not prompt me for my
> username or password, but apparently still waits for it eternally and
> the command just never completes.

It's a known issue under MS Windows. See 7.2 here:

http://www.gnu.org/software/emacs/windows/Sub_002dprocesses.html#Sub_002dprocesses

> Any pointers on how to debug this would be greatly appreciated.

As far as I know, the generally accepted way is to set up Git to use
plink.exe instead of plain SSH. You'd need to launch pageant.exe before
using any Git functionality that requires authentication, but on the
upside, you'll only have to enter the password once per startup.

https://github.com/hbons/SparkleShare/wiki/Using-putty-pageant-as-ssh-agent
http://stackoverflow.com/questions/2985074/how-do-i-set-git-to-use-plink-exe

-- Dmitry




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Using msysgit and Github and eshell/shell on Windows
  2012-06-13 10:01 ` Dmitry Gutov
@ 2012-07-13 15:36   ` Samuel Bronson
  0 siblings, 0 replies; 3+ messages in thread
From: Samuel Bronson @ 2012-07-13 15:36 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel


On Jun 13, 2012, at 6:01 AM, Dmitry Gutov wrote:

> Hi Bastian,
>
>> Whenever I run any git command that requires authentication (push,
>> pull, fetch basically), Emacs starts the git process, but it never
>> finishes. If I use the same commands (with the same executables) in
>> different shells such as CMD, powershell, the git shell or the msys
>> shell, git prompts me for my username and password. If I run the same
>> commands in Emacs on OSX, Emacs even prompts me for my possword in  
>> the
>> minibuffer! On Windows however, Emacs does not prompt me for my
>> username or password, but apparently still waits for it eternally and
>> the command just never completes.
>
> It's a known issue under MS Windows. See 7.2 here:
>
> http://www.gnu.org/software/emacs/windows/Sub_002dprocesses.html#Sub_002dprocesses

Section 7.2 ends rather suddenly... but this happens because Windows  
doesn't use ptys, instead electing to have all "terminal" windows  
(called Consoles) handled by a single program, to which ntdll.dll is  
essentially hard-wired.  (I suppose 9x probably implemented it in  
kernel32.dll directly?)

>> Any pointers on how to debug this would be greatly appreciated.
>
> As far as I know, the generally accepted way is to set up Git to use
> plink.exe instead of plain SSH. You'd need to launch pageant.exe  
> before
> using any Git functionality that requires authentication, but on the
> upside, you'll only have to enter the password once per startup.

That's certainly what I do.  Though I am, in point of fact, too lazy  
to even bother with passphrases on my SSH keys under *nix, and only  
did it on Windows because the prevalence of malware and the fact that  
I was keeping these particular keys on a flash drive made me  
uncomfortable leaving them unlocked.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-13 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13  8:08 Using msysgit and Github and eshell/shell on Windows Bastian Bechtold
2012-06-13 10:01 ` Dmitry Gutov
2012-07-13 15:36   ` Samuel Bronson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).