Re: [PATCH] stop putting argv[0] dirname at front of PATH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Jeff King wrote:

>                                         This was added long
> ago by by 231af83 (Teach the "git" command to handle some
> commands internally, 2006-02-26), with the intent that
> things would just work if you did something like:
>
>   cd /opt
>   tar xzf premade-git-package.tar.gz
>   alias git=/opt/git/bin/git
>
> as we would then find all of the related external commands
> in /opt/git/bin. I.e., it made git runtime-relocatable,
> since at the time of 231af83, we installed all of the git
> commands into $(bindir).
[...]
>                                                          And
> not just for finding binaries; we want to find $(sharedir),
> etc, the same way.  The RUNTIME_PREFIX build knob does this
> the right way

Makes sense.  For the reason you say (templatedir, etc) I am surprised
to hear that that was the motivation, but I can't find any other.

[...]
> Signed-off-by: Jeff King <peff@xxxxxxxx>

For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@xxxxxxxxx>

[...]
>                                          But note that you can't just
> flip on RUNTIME_PREFIX on non-Windows systems, as some invocations will
> get the full path to the executable, and others see just "git". You'd
> need to convert that into an absolute path (either by searching the
> $PATH, or doing something system-specific like looking in /proc/$$/exe).

Yep --- /proc/self/exe should work okay if someone wants "portable
git" to work on Linux.

Thanks,
Jonathan
--
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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]