From: Junio C Hamano Date: Tue, 31 Jul 2007 08:20:54 GMT Subject: Re: "git stash" is not known to git Message-ID: <7vps29f0gp.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20070730100408.GA8829@coredump.intra.peff.net> Jeff King writes: > We never actually look in the regular PATH since we call execv_git_cmd > (although we do still munge the PATH, apparently so shell scripts can > use git-foo syntax; see 77cb17e9). This means you can't drop "git-foo" > into your PATH and have it work as "git foo". Would this be a good replacement? diff --git a/git.c b/git.c index 2433355..25b8274 100644 --- a/git.c +++ b/git.c @@ -448,11 +448,11 @@ int main(int argc, const char **argv) cmd = argv[0]; /* - * We search for git commands in the following order: - * - git_exec_path() - * - the path of the "git" command if we could find it - * in $0 - * - the regular PATH. + * We execute external git command via execv_git_cmd(), + * which looks at "--exec-path" option, GIT_EXEC_PATH + * environment, and $(gitexecdir) in Makefile while built, + * in this order. For scripted commands, we prepend + * the value of the exec_path variable to the PATH. */ if (exec_path) prepend_to_path(exec_path, strlen(exec_path));