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

Re: [PATCH 1/2] Remember and use GIT_EXEC_PATH on exec()'s

From
Junio C Hamano <junkio@cox.net>
Date
Jan 10, 2006, 02:53 UTC
Message-ID
<7vfynwbxpc.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1136849754.11717.517.camel@brick.watson.ibm.com>
Michal Ostrowski <mostrows@watson.ibm.com> writes:
Show 5 quoted lines
> If git-upload-pack is invoked by ssh, it may have been invoked because
> ssh was explicitly told which program to execute on the remote end
> (i.e. --exec had been used with git-clone-pack).  In this case, the
> git suite may not be in the PATH, and so subsequent exec's by
> git-upload-pack (i.e. git-rev-list, git-pack-objects) will fail.
True.
> +.environment.GIT_EXEC_PATH:
> +	@(test -e $@ && grep -h -e '^$(bindir)$$' $@) || echo $(bindir) > $@
Hmph.
  * I did not know "test -e" was portable (it is in POSIX.1),
    but since you are creating the file yourself anyway,
    wouldn't "test -f" look more familiar?
  * Perhaps grep -F (--fixed-strings), not as regexp?
  * I do not get the point of using "grep -h" here (it's not in
    POSIX.1).  Perhaps just >/dev/null?

But I like the timestamp trick here that uses ||. Maybe I should borrow it for GIT-VERSION-GEN. Maybe not.

Show 9 quoted lines
> --- a/environment.c
> +++ b/environment.c
> @@ -9,6 +9,10 @@
>   */
>  #include "cache.h"
>  
> +#ifndef GIT_EXEC_PATH
> +#define GIT_EXEC_PATH NULL
> +#endif
I wonder if not having GIT_EXEC_PATH defined should be an error here.
> +void git_setup_exec_path(void)
> +{
>...
> +}

Maybe move git.c::prepend_to_path() to a single library file and use it here?

Previous: Michal OstrowskiNext: Michal Ostrowski
Message 3 of 33 in “Remember and use GIT_EXEC_PATH on exec()'s”
  1. 0/2 Remember and use GIT_EXEC_PATH on exec()'sMichal Ostrowski, Jan 9, 2006
  2. 1/2 Remember and use GIT_EXEC_PATH on exec()'sMichal Ostrowski, Jan 9, 2006
  3. Junio C HamanoJan 10, 2006
  4. 2/2 Remember and use GIT_EXEC_PATH on exec()'sMichal Ostrowski, Jan 9, 2006
  5. Junio C HamanoJan 10, 2006
  6. Michal OstrowskiJan 10, 2006
  7. Andreas EricssonJan 10, 2006
  8. Michal OstrowskiJan 10, 2006
  9. Andreas EricssonJan 10, 2006
  10. Alex RiesenJan 10, 2006
  11. Michal OstrowskiJan 10, 2006
  12. Junio C HamanoJan 10, 2006
  13. Johannes SchindelinJan 10, 2006
  14. Michal OstrowskiJan 10, 2006
  15. Johannes SchindelinJan 10, 2006
  16. Andreas EricssonJan 11, 2006
  17. Junio C HamanoJan 11, 2006
  18. Andreas EricssonJan 11, 2006
  19. Jon LoeligerJan 11, 2006
  20. Junio C HamanoJan 10, 2006
  21. Michal OstrowskiJan 10, 2006
  22. Andreas EricssonJan 11, 2006
  23. Junio C HamanoJan 11, 2006
  24. Michal OstrowskiJan 11, 2006
  25. Exec git programs without using PATH.Michal Ostrowski, Jan 11, 2006
  26. Junio C HamanoJan 11, 2006
  27. (Updated) Exec git programs without using PATH.Michal Ostrowski, Jan 11, 2006
  28. Junio C HamanoJan 11, 2006
  29. Linus TorvaldsJan 11, 2006
  30. Michal OstrowskiJan 11, 2006
  31. Junio C HamanoJan 11, 2006
  32. Andreas EricssonJan 12, 2006
  33. H. Peter AnvinJan 12, 2006

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.