ggreer/the_silver_searcher — pull request #340 by cowens (2014-02-23 13:06:52+00:00)
Title: Don't complain if git isn't installed

Currently, if git isn't installed you get "sh: git: command not found\n" printed to stderr. A better solution might be to search for git in the PATH and only run it if it is found, but I don't see a reason to reimplement the search sh can already do. Another option would be to have a --with-git= in the configure script (people without git could pass --with-git=/bin/true), but that would require a recompile if git were to be installed later. A third, and possibly best, option would be to have a config file where you could specify which executable to run (if at all), but again, that is more code. I also don't see a need for any error messages git might produce, so discarding stderr for this command is probably the right answer anyway. If it fails, ag will just search more than intended.