git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-gui: Make git-gui lib dir configurable at runtime
@ 2014-07-21 18:20 David Turner
  2014-07-21 21:06 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: David Turner @ 2014-07-21 18:20 UTC (permalink / raw)
  To: git; +Cc: David Turner

Introduce the GIT_GUI_LIB_DIR environment variable, to tell git-gui
where to look for TCL libs.  This allows a git-gui which has been
built with a prefix of /foo to be run out of directory /bar.  This is
the equivalent of GIT_EXEC_PATH or GITPERLLIB but for git-gui's TCL
libraries.

Signed-off-by: David Turner <dturner@twitter.com>
---
 git-gui/Makefile   | 3 ++-
 git-gui/git-gui.sh | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/git-gui/Makefile b/git-gui/Makefile
index cde8b2e..56bf9e2 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -177,7 +177,8 @@ git-gui: GIT-VERSION-FILE GIT-GUI-VARS
 	echo then >>$@+ && \
 	echo '	'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
 	echo else >>$@+ && \
-	echo '	'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\' \
+	echo '	libdir="$$(GIT_GUI_LIB_DIR:-$(libdir_SQ))"' >>$@+ && \
+	echo '	'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \
 		'"$$0" "$$@"' >>$@+ && \
 	echo fi >>$@+ && \
 	chmod +x $@+ && \
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index b186329..6cbb36e 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -49,7 +49,11 @@ catch {rename send {}} ; # What an evil concept...
 ##
 ## locate our library
 
-set oguilib {@@GITGUI_LIBDIR@@}
+if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
+	set oguilib $::env(GIT_GUI_LIB_DIR)
+} else {
+	set oguilib {@@GITGUI_LIBDIR@@}
+}
 set oguirel {@@GITGUI_RELATIVE@@}
 if {$oguirel eq {1}} {
 	set oguilib [file dirname [file normalize $argv0]]
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-gui: Make git-gui lib dir configurable at runtime
  2014-07-21 18:20 [PATCH] git-gui: Make git-gui lib dir configurable at runtime David Turner
@ 2014-07-21 21:06 ` Junio C Hamano
  2014-07-21 21:57   ` David Turner
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2014-07-21 21:06 UTC (permalink / raw)
  To: David Turner; +Cc: git, David Turner, Pat Thoyts

David Turner <dturner@twopensource.com> writes:

> Introduce the GIT_GUI_LIB_DIR environment variable, to tell git-gui
> where to look for TCL libs.  This allows a git-gui which has been
> built with a prefix of /foo to be run out of directory /bar.  This is
> the equivalent of GIT_EXEC_PATH or GITPERLLIB but for git-gui's TCL
> libraries.
>
> Signed-off-by: David Turner <dturner@twitter.com>
> ---
>  git-gui/Makefile   | 3 ++-
>  git-gui/git-gui.sh | 6 +++++-
>  2 files changed, 7 insertions(+), 2 deletions(-)

Would a similar change to gitk necessary/beneficial to platforms
that would benefit from this change?

git-gui directory in my tree comes from its upstream repository
git://repo.or.cz/git-gui.git/, and it is maintained by Pat Thoyts
(Cc'ed).

gitk is from git://ozlabs.org/~paulus/gitk.git maintained by Paul
Mackerras <paulus@samba.org> (not Cc'ed).

Note that these two upstream projects do not have leading
directories git-gui and gitk-git themselves (they are merged to my
tree while their paths being renamed).  A patch that is appliable to
them would touch paths without them (e.g. Makefile and git-gui.sh
for an equivalent of the patch I am responding to).

Thanks.

> diff --git a/git-gui/Makefile b/git-gui/Makefile
> index cde8b2e..56bf9e2 100644
> --- a/git-gui/Makefile
> +++ b/git-gui/Makefile
> @@ -177,7 +177,8 @@ git-gui: GIT-VERSION-FILE GIT-GUI-VARS
>  	echo then >>$@+ && \
>  	echo '	'echo \'git-gui version '$(GITGUI_VERSION)'\' >>$@+ && \
>  	echo else >>$@+ && \
> -	echo '	'exec \''$(libdir_SQ)/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\' \
> +	echo '	libdir="$$(GIT_GUI_LIB_DIR:-$(libdir_SQ))"' >>$@+ && \
> +	echo '	'exec \"'$$libdir/Git Gui.app/Contents/MacOS/$(subst \,,$(TKEXECUTABLE))'\" \
>  		'"$$0" "$$@"' >>$@+ && \
>  	echo fi >>$@+ && \
>  	chmod +x $@+ && \
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index b186329..6cbb36e 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -49,7 +49,11 @@ catch {rename send {}} ; # What an evil concept...
>  ##
>  ## locate our library
>  
> -set oguilib {@@GITGUI_LIBDIR@@}
> +if { [info exists ::env(GIT_GUI_LIB_DIR) ] } {
> +	set oguilib $::env(GIT_GUI_LIB_DIR)
> +} else {
> +	set oguilib {@@GITGUI_LIBDIR@@}
> +}
>  set oguirel {@@GITGUI_RELATIVE@@}
>  if {$oguirel eq {1}} {
>  	set oguilib [file dirname [file normalize $argv0]]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-gui: Make git-gui lib dir configurable at runtime
  2014-07-21 21:06 ` Junio C Hamano
@ 2014-07-21 21:57   ` David Turner
  2014-08-10 12:03     ` Pat Thoyts
  0 siblings, 1 reply; 5+ messages in thread
From: David Turner @ 2014-07-21 21:57 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, David Turner, Pat Thoyts

On Mon, 2014-07-21 at 14:06 -0700, Junio C Hamano wrote:
> David Turner <dturner@twopensource.com> writes:
> 
> > Introduce the GIT_GUI_LIB_DIR environment variable, to tell git-gui
> > where to look for TCL libs.  This allows a git-gui which has been
> > built with a prefix of /foo to be run out of directory /bar.  This is
> > the equivalent of GIT_EXEC_PATH or GITPERLLIB but for git-gui's TCL
> > libraries.
> >
> > Signed-off-by: David Turner <dturner@twitter.com>
> > ---
> >  git-gui/Makefile   | 3 ++-
> >  git-gui/git-gui.sh | 6 +++++-
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> 
> Would a similar change to gitk necessary/beneficial to platforms
> that would benefit from this change?

Apparently not; it seems to work fine for me from an alternate location.
Convenient!

> git-gui directory in my tree comes from its upstream repository
> git://repo.or.cz/git-gui.git/, and it is maintained by Pat Thoyts
> (Cc'ed).

> Note that these two upstream projects do not have leading
> directories git-gui and gitk-git themselves (they are merged to my
> tree while their paths being renamed).  A patch that is appliable to
> them would touch paths without them (e.g. Makefile and git-gui.sh
> for an equivalent of the patch I am responding to).

Pat, do you want patches via the git mailing list, personal mail, or
some other way?  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-gui: Make git-gui lib dir configurable at runtime
  2014-07-21 21:57   ` David Turner
@ 2014-08-10 12:03     ` Pat Thoyts
  2014-08-12 16:38       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Pat Thoyts @ 2014-08-10 12:03 UTC (permalink / raw)
  To: David Turner; +Cc: Junio C Hamano, git, David Turner

David Turner <dturner@twopensource.com> writes:

>On Mon, 2014-07-21 at 14:06 -0700, Junio C Hamano wrote:
>> David Turner <dturner@twopensource.com> writes:
>> 
>> > Introduce the GIT_GUI_LIB_DIR environment variable, to tell git-gui
>> > where to look for TCL libs.  This allows a git-gui which has been
>> > built with a prefix of /foo to be run out of directory /bar.  This is
>> > the equivalent of GIT_EXEC_PATH or GITPERLLIB but for git-gui's TCL
>> > libraries.
>> >
>> > Signed-off-by: David Turner <dturner@twitter.com>
>> > ---
>> >  git-gui/Makefile   | 3 ++-
>> >  git-gui/git-gui.sh | 6 +++++-
>> >  2 files changed, 7 insertions(+), 2 deletions(-)
>> 
>> Would a similar change to gitk necessary/beneficial to platforms
>> that would benefit from this change?
>
>Apparently not; it seems to work fine for me from an alternate location.
>Convenient!
>
>> git-gui directory in my tree comes from its upstream repository
>> git://repo.or.cz/git-gui.git/, and it is maintained by Pat Thoyts
>> (Cc'ed).
>
>> Note that these two upstream projects do not have leading
>> directories git-gui and gitk-git themselves (they are merged to my
>> tree while their paths being renamed).  A patch that is appliable to
>> them would touch paths without them (e.g. Makefile and git-gui.sh
>> for an equivalent of the patch I am responding to).
>
>Pat, do you want patches via the git mailing list, personal mail, or
>some other way?  
>

The standard method is both: personal to ensure I see it and mailing list to
allow everyone to comment.

I've applied this patch to git-gui master.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] git-gui: Make git-gui lib dir configurable at runtime
  2014-08-10 12:03     ` Pat Thoyts
@ 2014-08-12 16:38       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2014-08-12 16:38 UTC (permalink / raw)
  To: patthoyts; +Cc: David Turner, git, David Turner

Pat Thoyts <patthoyts@users.sourceforge.net> writes:

>>Pat, do you want patches via the git mailing list, personal mail, or
>>some other way?  
>>
>
> The standard method is both: personal to ensure I see it and mailing list to
> allow everyone to comment.
>
> I've applied this patch to git-gui master.

Thanks, both.  Is it a good time to pull the changes from you to be
in the final 2.1 release?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-12 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-21 18:20 [PATCH] git-gui: Make git-gui lib dir configurable at runtime David Turner
2014-07-21 21:06 ` Junio C Hamano
2014-07-21 21:57   ` David Turner
2014-08-10 12:03     ` Pat Thoyts
2014-08-12 16:38       ` Junio C Hamano

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).