git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'

From
Steffen Prohaska <prohaska@zib.de>
Date
Jul 28, 2008, 05:01 UTC
Message-ID
<AF6C526A-57ED-4386-A4CF-5260D82026B7@zib.de>
In-Reply-To
<20080727212405.GA10075@spearce.org>
On Jul 27, 2008, at 11:24 PM, Shawn O. Pearce wrote:
Show 24 quoted lines
> Steffen Prohaska <prohaska@zib.de> wrote:
>> The new execdir has is two levels below the root directory, while
>> the old execdir 'bin' was only one level below.  This commit
>> adapts the discovery of oguilib that uses relative paths
>> accordingly.
> ...
>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>> index 940677c..baccd57 100755
>> --- a/git-gui/git-gui.sh
>> +++ b/git-gui/git-gui.sh
>> @@ -52,7 +52,9 @@ catch {rename send {}} ; # What an evil concept...
>> set oguilib {@@GITGUI_LIBDIR@@}
>> set oguirel {@@GITGUI_RELATIVE@@}
>> if {$oguirel eq {1}} {
>> -	set oguilib [file dirname [file dirname [file normalize $argv0]]]
>> +	set oguilib [file dirname \
>> +	             [file dirname \
>> +	              [file dirname [file normalize $argv0]]]]
>> 	set oguilib [file join $oguilib share git-gui lib]
>
> Hmmph.  This actually comes up incorrectly on my system.  The issue
> appears to be `git --exec-path` gives me $prefix/libexec/git-core,
> and git-gui installs its library into $prefix/libexec/share, which
> is wrong.  It should have gone to $prefix/share.

I am not seeing this problem because I am installing using the toplevel makefile, which sets and exports sharedir to $prefix/share.

Show 31 quoted lines
> I wonder if this is better.  Your other two patches seem fine.
>
> --8<--
> [PATCH] git-gui: Correct installation of library to be $prefix/share
>
> We always wanted the library for git-gui to install into the
> $prefix/share directory, not $prefix/libexec/share.  All of
> the files in our library are platform independent and may
> be reused across systems, like any other content stored in
> the share directory.
>
> Our computation of where our library should install to was broken
> when git itself started installing to $prefix/libexec/git-core,
> which was one level down from where we expected it to be.
>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
> ---
> Makefile |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index b19fb2d..f72ab6c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -32,6 +32,9 @@ endif
> ifndef gitexecdir
> 	gitexecdir := $(shell git --exec-path)
> endif
> +ifeq (git-core,$(notdir $(gitexecdir)))
> +	gitexecdir := $(patsubst %/,%,$(dir $(gitexecdir)))
> +endif

But gitexecdir has the correct value, no? gitexecdir is used at several places in the makefile. It seems wrong to strip 'git-core' from gitexecdir. But I must admit that I do not understand all the details of git-gui's Makefile. So maybe you know better.

Isn't only the computation of sharedir based on gitexecdir wrong?
> ifndef sharedir
> 	sharedir := $(dir $(gitexecdir))share
and could be replaced with this (instead of your patch):
  ifndef sharedir
+ifeq (git-core,$(notdir $(gitexecdir)))
+       sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share
+else
         sharedir := $(dir $(gitexecdir))share
  endif
+endif
	Steffen
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 6 of 13 in “git-gui (Windows): Adapt to new execdir 'libexec/git-core'”
  1. 0/3 git-gui (Windows): Adapt to new execdir 'libexec/git-core'Steffen Prohaska, Jul 27, 2008
  2. 1/3 git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'Steffen Prohaska, Jul 27, 2008
  3. 2/3 git-gui (Windows): Switch to relative discovery of oguilibSteffen Prohaska, Jul 27, 2008
  4. 3/3 git-gui (Windows): Change wrapper to execdir 'libexec/git-core'Steffen Prohaska, Jul 27, 2008
  5. Shawn O. PearceJul 27, 2008
  6. Steffen ProhaskaJul 28, 2008
  7. Shawn O. PearceJul 30, 2008
  8. Steffen ProhaskaJul 30, 2008
  9. Johannes SixtAug 3, 2008
  10. Steffen ProhaskaAug 3, 2008
  11. git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'Johannes Sixt, Aug 4, 2008
  12. Shawn O. PearceAug 4, 2008
  13. git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'Johannes Sixt, Aug 4, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.