]> git.ipfire.org Git - thirdparty/git.git/commit - cache.h
exec_cmd: RUNTIME_PREFIX on some POSIX systems
authorDan Jacques <dnj@google.com>
Tue, 10 Apr 2018 15:05:44 +0000 (11:05 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Apr 2018 09:10:28 +0000 (18:10 +0900)
commit226c0ddd0d63dd6c8dde497c755af2ad1f02e0c1
tree232d124263ccd6aa6370ac0e100c32b68c70fb94
parent07d90eadb50ee687a7313186b654975b0944a74e
exec_cmd: RUNTIME_PREFIX on some POSIX systems

Enable Git to resolve its own binary location using a variety of
OS-specific and generic methods, including:

- procfs via "/proc/self/exe" (Linux)
- _NSGetExecutablePath (Darwin)
- KERN_PROC_PATHNAME sysctl on BSDs.
- argv0, if absolute (all, including Windows).

This is used to enable RUNTIME_PREFIX support for non-Windows systems,
notably Linux and Darwin. When configured with RUNTIME_PREFIX, Git will
do a best-effort resolution of its executable path and automatically use
this as its "exec_path" for relative helper and data lookups, unless
explicitly overridden.

Small incidental formatting cleanup of "exec_cmd.c".

Signed-off-by: Dan Jacques <dnj@google.com>
Thanks-to: Robbie Iannucci <iannucci@google.com>
Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
cache.h
common-main.c
config.mak.uname
exec_cmd.c
exec_cmd.h
gettext.c
git.c
t/t0061-run-command.sh