Re: Humble request of 'git' developers + [PATCH] Slight enhancement of GIT wrapper

From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Date: 2016-06-15 22:41:54

Hello All,

I am resending patch from 13 April
which I have send Petr Baudis.
He has said, that he combines
best ideas from more similar patches
but he has not found time for that probably.
It is updated according his
and Johannes Schindelin's remarks.

It enables to move all growing number
of git scripts and programs to the any
directory out of the search path.
Actually only "git" script needs to be
linked symbolically to some directory
on the search path. This solution worked
for me with many versions of "git-pasky".

I would vote for this solution
and for single public exposed multiplexer
executable script.
It is how big portable place independent
projects solve hiding of garbage from
the search path.

Best wishes

                Pavel Pisa
        e-mail: pisa@cmp.felk.cvut.cz
        www:    http://cmp.felk.cvut.cz/~pisa
        work:   http://www.pikron.com




Slight enhancement of GIT wrapper

Git multiplexer and scripts can reside in non PATH directories
and linking git multiplexer into some searchables dirs makes the trick.

Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
--- git.orig	2005-04-24 00:12:56.000000000 +0200
+++ git	2005-04-24 01:28:01.000000000 +0200
@@ -17,6 +17,28 @@
 	exit 1
 }
 
+if [ -z "$GIT_TOOLS_DIR" ] ; then
+	GIT_MUXBINARY_DIR="$(dirname "$0")"
+	if [ -h "$0" ]; then
+		#GIT_TOOLS_DIR="$(ls -l "$0" | sed 's/^.*-> *\(.*\) *$/\1/')"
+		GIT_TOOLS_DIR="$(ls -L "$0")"
+	        GIT_TOOLS_DIR="$(dirname "$GIT_TOOLS_DIR")"
+		GIT_TOOLS_DIR="$(cd "$GIT_MUXBINARY_DIR" ; cd "$GIT_TOOLS_DIR" ; pwd )"
+	else
+		GIT_TOOLS_DIR="$(cd "$GIT_MUXBINARY_DIR" ; pwd )"
+	fi
+
+	if [ -z "$(echo :$PATH: | sed -n -e 's#:'"$GIT_TOOLS_DIR"':#yes#p' )" ] ; then
+		export PATH="$GIT_TOOLS_DIR:$PATH"
+	fi
+
+	export GIT_TOOLS_DIR
+fi
+
+#echo GIT_TOOLS_DIR=$GIT_TOOLS_DIR
+#echo PATH=$PATH
+#echo CWD=$(pwd)
+#exit 
 
 help () {
 	cat <<__END__
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help