git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git stash" is not known to git

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2007, 08:20 UTC
Message-ID
<7vps29f0gp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070730100408.GA8829@coredump.intra.peff.net>
Jeff King <peff@peff.net> 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));
Previous: Junio C HamanoNext: Jeff King
Message 12 of 14 in “"git stash" is not known to git”
  1. David KastrupJul 30, 2007
  2. Matthieu MoyJul 30, 2007
  3. David KastrupJul 30, 2007
  4. Jeff KingJul 30, 2007
  5. David KastrupJul 30, 2007
  6. Jeff KingJul 30, 2007
  7. David KastrupJul 30, 2007
  8. Jeff KingJul 30, 2007
  9. David KastrupJul 30, 2007
  10. Jeff KingJul 30, 2007
  11. Junio C HamanoJul 30, 2007
  12. Junio C HamanoJul 31, 2007
  13. Jeff KingJul 31, 2007
  14. Junio C HamanoJul 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.