composer/composer — Issue #340: Better error handling when git is not installed
Author: mikey179
Created: 2012-02-20 22:38:04+00:00
State: open

When you do an install or update on a system where git is not installed, and there's a dependency to a dev version hosted in a git repository, Composer will fail (obviously :-) but doesn't provide good error handling for the user to understand what's wrong.

Currently it doesn't detect that the command line call to git fails, and continues as nothing happened. This is especially problematic if the package defines binaries and you install on a Windows system: It still tries to create the windows proxy and tries to read the first line of the binary which will fail and give three error stacks for each binary printed to the command line.

So, composer should break the installation process in this case when git is not installed and present a proper error message regarding missing git instead.

(Maybe it would be a good idea to additionally introduce an `file_exists()` check before opening the binary in the `generateWindowsProxyCode()` method.)