• Dan Jacques's avatar
    exec_cmd: RUNTIME_PREFIX on some POSIX systems · 226c0ddd
    Dan Jacques authored
    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: default avatarDan Jacques <dnj@google.com>
    Thanks-to: Robbie Iannucci <iannucci@google.com>
    Thanks-to: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    226c0ddd
common-main.c 1.15 KB