Re: Teach the "git" command to handle some commands internally

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

 




On Sun, 26 Feb 2006, Junio C Hamano wrote:
> 
> > There's one other change: the search order for external programs is 
> > modified slightly, so that the first entry remains GIT_EXEC_DIR, but the 
> > second entry is the same directory as the git wrapper itself was executed 
> > out of - if we can figure it out from argv[0], of course.
> 
> I am not sure about this part, though.

Well, what it means is that _if_ you install all your "git" binaries in 
some directory that is not in your patch and is not GIT_EXEC_DIR, they 
will still magically work, assuming you don't do something strange.

IOW, you can do things like

	alias git=/opt/my-git/git

and all the "git" commands will automatically work fine, even if you 
didn't know at compile time where you would install them, and you didn't 
set GIT_EXEC_DIR at run-time. It will still first look in GIT_EXEC_DIR, 
but if that fails, it will take the git commands from /opt/my-git/ instead 
of from /usr/bin or whatever.

It seemed a nice thing to try to make the git wrapper execute whatever git 
version it was installed with, rather than depend on PATH.

But hey, it's only a couple of lines out of the whole thing, so you can 
certainly skip it (remove the

	if (exec_path)
		prepend_path(exec_path)

lines to disable it).

		Linus
-
: 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]