[issue3172] On Windows, git subrepos fail when the git is installed as git.cmd

hwiechers bugs at mercurial.selenic.com
Mon Dec 26 09:53:54 CST 2011


New submission from hwiechers <hwiechers at gmail.com>:

msysgit sometimes installs the git command as git.cmd.
The Popen(['git'], ...) call that runs git can't find it and causes hg to abort.

Here is an example:

  $ hg init test2
  $ cd $$
  $ git clone https://github.com/dlitz/python-pbkdf2.git
  Cloning into python-pbkdf2...
  remote: Counting objects: 26, done.
  remote: Compressing objects: 100% (21/21), done.
  remote: Total 26 (delta 8), reused 0 (delta 0)
  Unpacking objects: 100% (26/26), done.
  $ "python-pbkdf2 = [git]https://github.com/dlitz/python-pbkdf2.git" |
Out-File -Encoding Ascii .hgsub
  $ hg add .hgsub
  $ hg commit -m "Added git subrepo"
  abort: The system cannot find the file specified
  $ hg commit --debug -m "Added git subrepo"
  python-pbkdf2: git config --bool core.bare
  abort: The system cannot find the file specified

It seems that Popen(['git']) fails while Popen(['git.cmd']) succeeds.

  >>> p = subprocess.Popen(['git'])
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)
    File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
  WindowsError: [Error 2] The system cannot find the file specified
  >>> p = subprocess.Popen(['git.cmd'])
  >>> usage: git [--version] [--exec-path[=<path>]] [--html-path]
[--man-path] [--info-path]
             [-p|--paginate|--no-pager] [--no-replace-objects]
             [--bare] [--git-dir=<path>] [--work-tree=<path>]
             [-c name=value] [--help]
             <command> [<args>]

----------
messages: 18414
nosy: hwiechers
priority: bug
status: unread
title: On Windows, git subrepos fail when the git is installed as git.cmd

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3172>
____________________________________________________


More information about the Mercurial-devel mailing list