From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git binary directory?
Date: Sat, 05 Nov 2005 23:25:49 -0800 [thread overview]
Message-ID: <7vfyqa44qq.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0511051625110.3316@g5.osdl.org> (Linus Torvalds's message of "Sat, 5 Nov 2005 16:27:11 -0800 (PST)")
Linus Torvalds <torvalds@osdl.org> writes:
> This fixes the gitk thing, by installing it (along with git) in the
> regular $prefix/bin directory (ie default /usr/bin for the RPM).
The other half of the fix needed to gitk is to teach it to use
/usr/lib/git-@@VERSION@@ to locate git-rev-list and friends.
I really hate to do this, but here is an attempt on top of your
patch, which:
- makes gitk also use the @@GITDIR@@ to find git commands;
- makes git and gitk honor $GIT_LIBEXEC environment, to let you
override the hardcoded @@GITDIR@@;
- makes "make clean" to clean generated file git again.
I am not sure how to handle gitk part, but the best approach
would be to sell this change (including the rename) back to
Paulus the upstream.
---
diff --git a/Makefile b/Makefile
index 2e78089..1948aa1 100644
--- a/Makefile
+++ b/Makefile
@@ -327,6 +327,15 @@ git: git.sh Makefile
chmod +x $@+
mv $@+ $@
+gitk: gitk.tcl Makefile
+ rm -f $@+ $@
+ sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
+ -e 's:@@GITDIR@@:$(gitdir):g' \
+ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+ <$@.tcl >$@+
+ chmod +x $@+
+ mv $@+ $@
+
$(filter-out git,$(patsubst %.sh,%,$(SCRIPT_SH))) : % : %.sh
rm -f $@
sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
@@ -450,7 +459,7 @@ deb: dist
clean:
rm -f *.o mozilla-sha1/*.o ppc/*.o compat/*.o $(PROGRAMS) $(LIB_FILE)
- rm -f $(SCRIPTS)
+ rm -f $(SCRIPTS) git gitk
rm -f git-core.spec *.pyc *.pyo
rm -rf $(GIT_TARNAME)
rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
diff --git a/git.sh b/git.sh
index 9ba1608..f39b373 100755
--- a/git.sh
+++ b/git.sh
@@ -1,7 +1,13 @@
#!/bin/sh
cmd=
-path="@@GITDIR@@"
+case "$GIT_LIBEXEC" in
+'')
+ GIT_LIBEXEC='@@GITDIR@@'
+ export GIT_LIBEXEC
+ ;;
+esac
+path="$GIT_LIBEXEC"
export PATH="$path:$PATH"
case "$#" in
0) ;;
diff --git a/gitk b/gitk.tcl
similarity index 100%
rename from gitk
rename to gitk.tcl
index a9d37d9..be9a79e 100755
--- a/gitk
+++ b/gitk.tcl
@@ -7,6 +7,11 @@ exec wish "$0" -- "$@"
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or (at your option) any later version.
+if {![info exists env(GIT_LIBEXEC)]} {
+ set env(GIT_LIBEXEC) "@@GITDIR@@"
+}
+set env(PATH) "$env(GIT_LIBEXEC):$env(PATH)"
+
proc gitdir {} {
global env
if {[info exists env(GIT_DIR)]} {
next prev parent reply other threads:[~2005-11-06 7:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-05 21:02 git binary directory? Linus Torvalds
2005-11-05 23:52 ` Linus Torvalds
2005-11-06 0:27 ` Linus Torvalds
2005-11-06 7:25 ` Junio C Hamano [this message]
2005-11-06 2:49 ` Junio C Hamano
2005-11-06 3:12 ` Horst von Brand
2005-11-06 5:00 ` Kay Sievers
2005-11-06 5:36 ` Junio C Hamano
2005-11-06 8:23 ` Petr Baudis
2005-11-06 8:33 ` Junio C Hamano
2005-11-06 8:28 ` Petr Baudis
2005-11-06 4:25 ` Linus Torvalds
2005-11-06 5:37 ` Junio C Hamano
2005-11-06 16:20 ` Linus Torvalds
2005-11-06 20:15 ` Junio C Hamano
2005-11-06 22:19 ` Petr Baudis
2005-11-07 0:08 ` Junio C Hamano
2005-11-07 0:43 ` Petr Baudis
2005-11-07 0:54 ` Linus Torvalds
2005-11-07 9:45 ` Petr Baudis
2005-11-07 17:27 ` Junio C Hamano
2005-11-10 9:49 ` Petr Baudis
2005-11-09 13:32 ` Andreas Ericsson
[not found] <436D2269.6090605@slamail.org>
2005-11-05 21:43 ` Yaacov Akiba Slama
2005-11-06 8:56 ` Ben Clifford
2005-11-06 13:13 ` Nikolai Weibull
2005-11-06 14:05 ` Johannes Schindelin
2005-11-06 15:03 ` Nikolai Weibull
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vfyqa44qq.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).