This is a revival of the series of a week or so ago. I found a workaround for the problem that made me abondon the effort. The problem was that argv[0] does not have a path in certain cases. The workaround is in 8/9, namely to redefine main() and replace argv[0] by the value of _pgmptr that the C runtime on Windows provides and that always has a full path. Steffen has suggested not to the path discovery for 'git-*' programs. No change is necessary to do that because programs with a 'git-' prefix already take the path via handle_internal_command() early. 9/9 actually is off-topic, but it depends on 2/9 because it replaces the instance of git-shell in the ./check_bindir line by git-add. If you think it's worthwhile, you could squash this hunk into 2/9. I'll follow-up with 10/9, which is git-gui specific. Johannes Sixt (9): Makefile: Do not install a copy of 'git' in $(gitexecdir) Makefile: Normalize $(bindir) and $(gitexecdir) before comparing Record the command invocation path early Fix relative built-in paths to be relative to the command invocation Allow the built-in exec path to be relative to the command invocation path Allow add_path() to add non-existent directories to the path Windows: Make $(gitexecdir) relative Windows: Make sure argv[0] has a path Windows: Do not compile git-shell Makefile | 38 ++++++++++++++++++++++++-------------- abspath.c | 36 ++++++++++++++++++++++++++++++++++++ compat/mingw.h | 12 ++++++++++++ exec_cmd.c | 54 +++++++++++++----------------------------------------- exec_cmd.h | 3 ++- git.c | 5 ++--- path.c | 36 ------------------------------------ receive-pack.c | 2 +- shell.c | 4 ++-- upload-pack.c | 2 +- 10 files changed, 93 insertions(+), 99 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html