{"thread":{"id":"14706","subject":"[PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","startedAt":"2008-07-27T16:49:40Z","lastAt":"2008-08-04T20:09:46Z","messageCount":13,"participants":["Steffen Prohaska","Shawn O. Pearce","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"85179","messageId":"1217177383-25272-1-git-send-email-prohaska@zib.de","threadId":"14706","inReplyTo":null,"subject":"[PATCH 0/3] git-gui (Windows): Adapt to new execdir 'libexec/git-core'","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-07-27T16:49:40Z","receivedAt":"2008-07-27T16:49:40Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"After moving the dashed programs, including git-gui, to execdir\n'libexec/git-core', we have problems running git-gui from\nmsysgit.\n\nThe following patch series solves the problems.  I am not sure\nhowever if it is the less intrusive solution.  Maybe the series\nneeds further discussion before applying it.  Personally, I think\nthe patches are good enough.\n\nNote that you also need the branch 'spr/installer' in msysgit to\nbuild an installer.\n\n [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'\n [PATCH 2/3] git-gui (Windows): Switch to relative discovery of oguilib\n [PATCH 3/3] git-gui (Windows): Change wrapper to execdir 'libexec/git-core'\n"},{"id":"85176","messageId":"1217177383-25272-2-git-send-email-prohaska@zib.de","threadId":"14706","inReplyTo":"1217177383-25272-1-git-send-email-prohaska@zib.de","subject":"[PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-07-27T16:49:41Z","receivedAt":"2008-07-27T16:49:41Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"The new execdir has is two levels below the root directory, while\nthe old execdir 'bin' was only one level below.  This commit\nadapts the discovery of oguilib that uses relative paths\naccordingly.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n git-gui/git-gui.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 940677c..baccd57 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -52,7 +52,9 @@ catch {rename send {}} ; # What an evil concept...\n set oguilib {@@GITGUI_LIBDIR@@}\n set oguirel {@@GITGUI_RELATIVE@@}\n if {$oguirel eq {1}} {\n-\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n+\tset oguilib [file dirname \\\n+\t             [file dirname \\\n+\t              [file dirname [file normalize $argv0]]]]\n \tset oguilib [file join $oguilib share git-gui lib]\n \tset oguimsg [file join $oguilib msgs]\n } elseif {[string match @@* $oguirel]} {\n-- \n1.6.0.rc0.79.gb0320\n"},{"id":"85177","messageId":"1217177383-25272-3-git-send-email-prohaska@zib.de","threadId":"14706","inReplyTo":"1217177383-25272-2-git-send-email-prohaska@zib.de","subject":"[PATCH 2/3] git-gui (Windows): Switch to relative discovery of oguilib","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-07-27T16:49:42Z","receivedAt":"2008-07-27T16:49:42Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"Instead of using an absolute path, git-gui can discover its\ngui library using a relative path from execdir.  We want to\nuse the relative path discovery on MinGW to avoid issues\nwith translation of absolute paths.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n git-gui/Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui/Makefile b/git-gui/Makefile\nindex b19fb2d..ec4b33e 100644\n--- a/git-gui/Makefile\n+++ b/git-gui/Makefile\n@@ -156,6 +156,7 @@ endif\n ifneq (,$(findstring MINGW,$(uname_S)))\n \tNO_MSGFMT=1\n \tGITGUI_WINDOWS_WRAPPER := YesPlease\n+\tGITGUI_RELATIVE := 1\n endif\n \n ifdef GITGUI_MACOSXAPP\n-- \n1.6.0.rc0.79.gb0320\n"},{"id":"85178","messageId":"1217177383-25272-4-git-send-email-prohaska@zib.de","threadId":"14706","inReplyTo":"1217177383-25272-3-git-send-email-prohaska@zib.de","subject":"[PATCH 3/3] git-gui (Windows): Change wrapper to execdir 'libexec/git-core'","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-07-27T16:49:43Z","receivedAt":"2008-07-27T16:49:43Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"git-gui needs bindir in PATH to be able to run 'git'.  bindir\nhowever is not necessarily in PATH if started directly through a\nWindows shortcut.  Therefore, we used to add the directory\ngit-gui is located in.  But with the new 'libexec/git-core'\nlayout this directory is no longer identical to bindir.\n\nThis commit modifies the wrapper script to discover the bindir\nand add it to PATH.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\n---\n git-gui/windows/git-gui.sh |   11 +++++++----\n 1 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/git-gui/windows/git-gui.sh b/git-gui/windows/git-gui.sh\nindex 98f32c0..53c3a94 100644\n--- a/git-gui/windows/git-gui.sh\n+++ b/git-gui/windows/git-gui.sh\n@@ -8,9 +8,12 @@ if { $argc >=2 && [lindex $argv 0] == \"--working-dir\" } {\n \tincr argc -2\n }\n \n-set gitguidir [file dirname [info script]]\n-regsub -all \";\" $gitguidir \"\\\\;\" gitguidir\n-set env(PATH) \"$gitguidir;$env(PATH)\"\n-unset gitguidir\n+set bindir [file dirname \\\n+            [file dirname \\\n+             [file dirname [info script]]]]\n+set bindir [file join $bindir bin]\n+regsub -all \";\" $bindir \"\\\\;\" bindir\n+set env(PATH) \"$bindir;$env(PATH)\"\n+unset bindir\n \n source [file join [file dirname [info script]] git-gui.tcl]\n-- \n1.6.0.rc0.79.gb0320\n"},{"id":"85204","messageId":"20080727212405.GA10075@spearce.org","threadId":"14706","inReplyTo":"1217177383-25272-2-git-send-email-prohaska@zib.de","subject":"Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-27T21:24:05Z","receivedAt":"2008-07-27T21:24:05Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> wrote:\n> The new execdir has is two levels below the root directory, while\n> the old execdir 'bin' was only one level below.  This commit\n> adapts the discovery of oguilib that uses relative paths\n> accordingly.\n...\n> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n> index 940677c..baccd57 100755\n> --- a/git-gui/git-gui.sh\n> +++ b/git-gui/git-gui.sh\n> @@ -52,7 +52,9 @@ catch {rename send {}} ; # What an evil concept...\n>  set oguilib {@@GITGUI_LIBDIR@@}\n>  set oguirel {@@GITGUI_RELATIVE@@}\n>  if {$oguirel eq {1}} {\n> -\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n> +\tset oguilib [file dirname \\\n> +\t             [file dirname \\\n> +\t              [file dirname [file normalize $argv0]]]]\n>  \tset oguilib [file join $oguilib share git-gui lib]\n\nHmmph.  This actually comes up incorrectly on my system.  The issue\nappears to be `git --exec-path` gives me $prefix/libexec/git-core,\nand git-gui installs its library into $prefix/libexec/share, which\nis wrong.  It should have gone to $prefix/share.\n\nI wonder if this is better.  Your other two patches seem fine.\n\n--8<--\n[PATCH] git-gui: Correct installation of library to be $prefix/share\n\nWe always wanted the library for git-gui to install into the\n$prefix/share directory, not $prefix/libexec/share.  All of\nthe files in our library are platform independent and may\nbe reused across systems, like any other content stored in\nthe share directory.\n\nOur computation of where our library should install to was broken\nwhen git itself started installing to $prefix/libexec/git-core,\nwhich was one level down from where we expected it to be.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Makefile |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b19fb2d..f72ab6c 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -32,6 +32,9 @@ endif\n ifndef gitexecdir\n \tgitexecdir := $(shell git --exec-path)\n endif\n+ifeq (git-core,$(notdir $(gitexecdir)))\n+\tgitexecdir := $(patsubst %/,%,$(dir $(gitexecdir)))\n+endif\n \n ifndef sharedir\n \tsharedir := $(dir $(gitexecdir))share\n-- \n1.6.0.rc0.182.gb96c7\n\n\n-- \nShawn.\n"},{"id":"85235","messageId":"AF6C526A-57ED-4386-A4CF-5260D82026B7@zib.de","threadId":"14706","inReplyTo":"20080727212405.GA10075@spearce.org","subject":"Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-07-28T05:01:59Z","receivedAt":"2008-07-28T05:01:59Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Jul 27, 2008, at 11:24 PM, Shawn O. Pearce wrote:\n\n> Steffen Prohaska <prohaska@zib.de> wrote:\n>> The new execdir has is two levels below the root directory, while\n>> the old execdir 'bin' was only one level below.  This commit\n>> adapts the discovery of oguilib that uses relative paths\n>> accordingly.\n> ...\n>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n>> index 940677c..baccd57 100755\n>> --- a/git-gui/git-gui.sh\n>> +++ b/git-gui/git-gui.sh\n>> @@ -52,7 +52,9 @@ catch {rename send {}} ; # What an evil concept...\n>> set oguilib {@@GITGUI_LIBDIR@@}\n>> set oguirel {@@GITGUI_RELATIVE@@}\n>> if {$oguirel eq {1}} {\n>> -\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n>> +\tset oguilib [file dirname \\\n>> +\t             [file dirname \\\n>> +\t              [file dirname [file normalize $argv0]]]]\n>> \tset oguilib [file join $oguilib share git-gui lib]\n>\n> Hmmph.  This actually comes up incorrectly on my system.  The issue\n> appears to be `git --exec-path` gives me $prefix/libexec/git-core,\n> and git-gui installs its library into $prefix/libexec/share, which\n> is wrong.  It should have gone to $prefix/share.\n\nI am not seeing this problem because I am installing using the\ntoplevel makefile, which sets and exports sharedir to $prefix/share.\n\n\n> I wonder if this is better.  Your other two patches seem fine.\n>\n> --8<--\n> [PATCH] git-gui: Correct installation of library to be $prefix/share\n>\n> We always wanted the library for git-gui to install into the\n> $prefix/share directory, not $prefix/libexec/share.  All of\n> the files in our library are platform independent and may\n> be reused across systems, like any other content stored in\n> the share directory.\n>\n> Our computation of where our library should install to was broken\n> when git itself started installing to $prefix/libexec/git-core,\n> which was one level down from where we expected it to be.\n>\n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n> ---\n> Makefile |    3 +++\n> 1 files changed, 3 insertions(+), 0 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index b19fb2d..f72ab6c 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -32,6 +32,9 @@ endif\n> ifndef gitexecdir\n> \tgitexecdir := $(shell git --exec-path)\n> endif\n> +ifeq (git-core,$(notdir $(gitexecdir)))\n> +\tgitexecdir := $(patsubst %/,%,$(dir $(gitexecdir)))\n> +endif\n\nBut gitexecdir has the correct value, no?  gitexecdir is used\nat several places in the makefile.  It seems wrong to strip\n'git-core' from gitexecdir.  But I must admit that I do not\nunderstand all the details of git-gui's Makefile.  So maybe\nyou know better.\n\nIsn't only the computation of sharedir based on gitexecdir wrong?\n\n> ifndef sharedir\n> \tsharedir := $(dir $(gitexecdir))share\n\n\nand could be replaced with this (instead of your patch):\n\n  ifndef sharedir\n+ifeq (git-core,$(notdir $(gitexecdir)))\n+       sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share\n+else\n         sharedir := $(dir $(gitexecdir))share\n  endif\n+endif\n\n\tSteffen\n"},{"id":"85577","messageId":"20080730052517.GF7225@spearce.org","threadId":"14706","inReplyTo":"AF6C526A-57ED-4386-A4CF-5260D82026B7@zib.de","subject":"Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-30T05:25:17Z","receivedAt":"2008-07-30T05:25:17Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Steffen Prohaska <prohaska@zib.de> wrote:\n> Isn't only the computation of sharedir based on gitexecdir wrong?\n>\n>> ifndef sharedir\n>> \tsharedir := $(dir $(gitexecdir))share\n>\n> and could be replaced with this (instead of your patch):\n>\n>  ifndef sharedir\n> +ifeq (git-core,$(notdir $(gitexecdir)))\n> +       sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share\n> +else\n>         sharedir := $(dir $(gitexecdir))share\n>  endif\n> +endif\n\nOh, damn good catch.  Thanks.\n\nHow about this then?  Its your patch above, my message, and me\nforging your SOB...\n\n--8<--\nFrom: Steffen Prohaska <prohaska@zib.de>\nSubject: git-gui: Correct installation of library to be $prefix/share\n\nWe always wanted the library for git-gui to install into the\n$prefix/share directory, not $prefix/libexec/share.  All of\nthe files in our library are platform independent and may\nbe reused across systems, like any other content stored in\nthe share directory.\n\nOur computation of where our library should install to was broken\nwhen git itself started installing to $prefix/libexec/git-core,\nwhich was one level down from where we expected it to be.\n\nSigned-off-by: Steffen Prohaska <prohaska@zib.de>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Makefile |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex b19fb2d..c9d67fe 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -34,8 +34,12 @@ ifndef gitexecdir\n endif\n \n ifndef sharedir\n+ifeq (git-core,$(notdir $(gitexecdir)))\n+\tsharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share\n+else\n \tsharedir := $(dir $(gitexecdir))share\n endif\n+endif\n \n ifndef INSTALL\n \tINSTALL = install\n-- \n1.6.0.rc1.166.gbbfa8\n\n\n-- \nShawn.\n"},{"id":"85579","messageId":"59D4282F-7744-4FE2-92FC-11E72386BDEF@zib.de","threadId":"14706","inReplyTo":"20080730052517.GF7225@spearce.org","subject":"Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-07-30T05:39:57Z","receivedAt":"2008-07-30T05:39:57Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Jul 30, 2008, at 7:25 AM, Shawn O. Pearce wrote:\n\n> Steffen Prohaska <prohaska@zib.de> wrote:\n>> Isn't only the computation of sharedir based on gitexecdir wrong?\n>>\n>>> ifndef sharedir\n>>> \tsharedir := $(dir $(gitexecdir))share\n>>\n>> and could be replaced with this (instead of your patch):\n>>\n>> ifndef sharedir\n>> +ifeq (git-core,$(notdir $(gitexecdir)))\n>> +       sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share\n>> +else\n>>        sharedir := $(dir $(gitexecdir))share\n>> endif\n>> +endif\n>\n> Oh, damn good catch.  Thanks.\n>\n> How about this then?  Its your patch above, my message, and me\n> forging your SOB...\n\nlooks good.  SOB ok.\n\nThanks,\nSteffen\n"},{"id":"86053","messageId":"1217756103.48957bc76eda2@webmail.nextra.at","threadId":"14706","inReplyTo":"AF6C526A-57ED-4386-A4CF-5260D82026B7@zib.de","subject":"Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2008-08-03T09:35:03Z","receivedAt":"2008-08-03T09:35:03Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Zitat von Steffen Prohaska <prohaska@zib.de>:\n>\n> On Jul 27, 2008, at 11:24 PM, Shawn O. Pearce wrote:\n>\n> > Steffen Prohaska <prohaska@zib.de> wrote:\n> >> The new execdir has is two levels below the root directory, while\n> >> the old execdir 'bin' was only one level below.  This commit\n> >> adapts the discovery of oguilib that uses relative paths\n> >> accordingly.\n> > ...\n> >> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n> >> index 940677c..baccd57 100755\n> >> --- a/git-gui/git-gui.sh\n> >> +++ b/git-gui/git-gui.sh\n> >> @@ -52,7 +52,9 @@ catch {rename send {}} ; # What an evil concept...\n> >> set oguilib {@@GITGUI_LIBDIR@@}\n> >> set oguirel {@@GITGUI_RELATIVE@@}\n> >> if {$oguirel eq {1}} {\n> >> -\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n> >> +\tset oguilib [file dirname \\\n> >> +\t             [file dirname \\\n> >> +\t              [file dirname [file normalize $argv0]]]]\n> >> \tset oguilib [file join $oguilib share git-gui lib]\n> >\n> > Hmmph.  This actually comes up incorrectly on my system.  The issue\n> > appears to be `git --exec-path` gives me $prefix/libexec/git-core,\n> > and git-gui installs its library into $prefix/libexec/share, which\n> > is wrong.  It should have gone to $prefix/share.\n>\n> I am not seeing this problem because I am installing using the\n> toplevel makefile, which sets and exports sharedir to $prefix/share.\n>\n>\n> > I wonder if this is better.  Your other two patches seem fine.\n> >\n> > --8<--\n> > [PATCH] git-gui: Correct installation of library to be $prefix/share\n> >\n> > We always wanted the library for git-gui to install into the\n> > $prefix/share directory, not $prefix/libexec/share.  All of\n> > the files in our library are platform independent and may\n> > be reused across systems, like any other content stored in\n> > the share directory.\n> >\n> > Our computation of where our library should install to was broken\n> > when git itself started installing to $prefix/libexec/git-core,\n> > which was one level down from where we expected it to be.\n> >\n> > Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n> > ---\n> > Makefile |    3 +++\n> > 1 files changed, 3 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/Makefile b/Makefile\n> > index b19fb2d..f72ab6c 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -32,6 +32,9 @@ endif\n> > ifndef gitexecdir\n> > \tgitexecdir := $(shell git --exec-path)\n> > endif\n> > +ifeq (git-core,$(notdir $(gitexecdir)))\n> > +\tgitexecdir := $(patsubst %/,%,$(dir $(gitexecdir)))\n> > +endif\n>\n> But gitexecdir has the correct value, no?  gitexecdir is used\n> at several places in the makefile.  It seems wrong to strip\n> 'git-core' from gitexecdir.  But I must admit that I do not\n> understand all the details of git-gui's Makefile.  So maybe\n> you know better.\n>\n> Isn't only the computation of sharedir based on gitexecdir wrong?\n>\n> > ifndef sharedir\n> > \tsharedir := $(dir $(gitexecdir))share\n>\n>\n> and could be replaced with this (instead of your patch):\n>\n>   ifndef sharedir\n> +ifeq (git-core,$(notdir $(gitexecdir)))\n> +       sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share\n> +else\n>          sharedir := $(dir $(gitexecdir))share\n>   endif\n> +endif\n\nThis is not good enough in my environment. I run git-gui effectivly with\n\n   wish $prefix/libexec/git-core/git-gui\n\n(and I have $PATH set up to contain $bindir, but not $gitexecdir), and this\nneeds the original hunk with the three [file dirname ... ], because $argv0\npoints to $prefix/libexec/git-core/git-gui.\n\nI thought I understood what's going on, but I don't anymore.\n\nMybe the relative discovery of oguilib must be conditional on the \"git-core\"\npart as well, just like you discover sharedir?\n\n-- Hannes\n"},{"id":"86054","messageId":"58FBF585-377C-40A7-818E-6B47F8FD2EB8@zib.de","threadId":"14706","inReplyTo":"1217756103.48957bc76eda2@webmail.nextra.at","subject":"Re: [PATCH 1/3] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Steffen Prohaska","fromEmail":"prohaska@zib.de","sentAt":"2008-08-03T10:09:29Z","receivedAt":"2008-08-03T10:09:29Z","isPatch":true,"sender":{"key":"prohaska@zib.de","avatar":"https://avatars.githubusercontent.com/u/217580?v=4"},"body":"\nOn Aug 3, 2008, at 11:35 AM, Johannes Sixt wrote:\n\n> Zitat von Steffen Prohaska <prohaska@zib.de>:\n>>\n>> On Jul 27, 2008, at 11:24 PM, Shawn O. Pearce wrote:\n>>\n>>> Steffen Prohaska <prohaska@zib.de> wrote:\n>>>> The new execdir has is two levels below the root directory, while\n>>>> the old execdir 'bin' was only one level below.  This commit\n>>>> adapts the discovery of oguilib that uses relative paths\n>>>> accordingly.\n>>> ...\n>>>> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n>>>> index 940677c..baccd57 100755\n>>>> --- a/git-gui/git-gui.sh\n>>>> +++ b/git-gui/git-gui.sh\n>>>> @@ -52,7 +52,9 @@ catch {rename send {}} ; # What an evil  \n>>>> concept...\n>>>> set oguilib {@@GITGUI_LIBDIR@@}\n>>>> set oguirel {@@GITGUI_RELATIVE@@}\n>>>> if {$oguirel eq {1}} {\n>>>> -\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n>>>> +\tset oguilib [file dirname \\\n>>>> +\t             [file dirname \\\n>>>> +\t              [file dirname [file normalize $argv0]]]]\n>>>> \tset oguilib [file join $oguilib share git-gui lib]\n>>>\n>>> Hmmph.  This actually comes up incorrectly on my system.  The issue\n>>> appears to be `git --exec-path` gives me $prefix/libexec/git-core,\n>>> and git-gui installs its library into $prefix/libexec/share, which\n>>> is wrong.  It should have gone to $prefix/share.\n>>\n>> I am not seeing this problem because I am installing using the\n>> toplevel makefile, which sets and exports sharedir to $prefix/share.\n>>\n>>\n>>> I wonder if this is better.  Your other two patches seem fine.\n>>>\n>>> --8<--\n>>> [PATCH] git-gui: Correct installation of library to be $prefix/share\n>>>\n>>> We always wanted the library for git-gui to install into the\n>>> $prefix/share directory, not $prefix/libexec/share.  All of\n>>> the files in our library are platform independent and may\n>>> be reused across systems, like any other content stored in\n>>> the share directory.\n>>>\n>>> Our computation of where our library should install to was broken\n>>> when git itself started installing to $prefix/libexec/git-core,\n>>> which was one level down from where we expected it to be.\n>>>\n>>> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n>>> ---\n>>> Makefile |    3 +++\n>>> 1 files changed, 3 insertions(+), 0 deletions(-)\n>>>\n>>> diff --git a/Makefile b/Makefile\n>>> index b19fb2d..f72ab6c 100644\n>>> --- a/Makefile\n>>> +++ b/Makefile\n>>> @@ -32,6 +32,9 @@ endif\n>>> ifndef gitexecdir\n>>> \tgitexecdir := $(shell git --exec-path)\n>>> endif\n>>> +ifeq (git-core,$(notdir $(gitexecdir)))\n>>> +\tgitexecdir := $(patsubst %/,%,$(dir $(gitexecdir)))\n>>> +endif\n>>\n>> But gitexecdir has the correct value, no?  gitexecdir is used\n>> at several places in the makefile.  It seems wrong to strip\n>> 'git-core' from gitexecdir.  But I must admit that I do not\n>> understand all the details of git-gui's Makefile.  So maybe\n>> you know better.\n>>\n>> Isn't only the computation of sharedir based on gitexecdir wrong?\n>>\n>>> ifndef sharedir\n>>> \tsharedir := $(dir $(gitexecdir))share\n>>\n>>\n>> and could be replaced with this (instead of your patch):\n>>\n>>  ifndef sharedir\n>> +ifeq (git-core,$(notdir $(gitexecdir)))\n>> +       sharedir := $(dir $(patsubst %/,%,$(dir $(gitexecdir))))share\n>> +else\n>>         sharedir := $(dir $(gitexecdir))share\n>>  endif\n>> +endif\n>\n> This is not good enough in my environment.\n\nThis only fixes the installation directory.\n\n\n> I run git-gui effectivly with\n>\n>   wish $prefix/libexec/git-core/git-gui\n>\n> (and I have $PATH set up to contain $bindir, but not $gitexecdir),  \n> and this\n> needs the original hunk with the three [file dirname ... ], because  \n> $argv0\n> points to $prefix/libexec/git-core/git-gui.\n\nThe original hunk fixes the discovery of oguilib, i.e.\nfrom $prefix/libexec/git-core/git-gui to $prefix/share/git-gui/lib\n\nI didn't recognize that the the 'three [file dinames ...]' have\nnot been applied because I had this change already in 4msysgit\n(and still have).  Apologies for not checking this more carefully.\n\n\n> I thought I understood what's going on, but I don't anymore.\n>\n> Mybe the relative discovery of oguilib must be conditional on the  \n> \"git-core\"\n> part as well, just like you discover sharedir?\n\nHmm... you are right.  If we want to maintain compatibility\nwith *both* directory layouts, obviously all computations\nthat depend on the layout need to be conditional on it.\n\n\tSteffen\n"},{"id":"86220","messageId":"1217879912.48975f6809e10@webmail.nextra.at","threadId":"14706","inReplyTo":"58FBF585-377C-40A7-818E-6B47F8FD2EB8@zib.de","subject":"[PATCH] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2008-08-04T19:58:32Z","receivedAt":"2008-08-04T19:58:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The new execdir has is two levels below the root directory, while\nthe old execdir 'bin' was only one level below.  This commit\nadapts the discovery of oguilib that uses relative paths\naccordingly. We determine whether we have the extra level in the same\nway in which the Makefile defines sharedir, i.e. whether the last\ndirectory part is 'git-core'.\n\nInspired-by: Steffen Prohaska <prohaska@zib.de>\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n\nZitat von Steffen Prohaska <prohaska@zib.de>:\n>\n> On Aug 3, 2008, at 11:35 AM, Johannes Sixt wrote:\n> > I run git-gui effectivly with\n> >\n> >   wish $prefix/libexec/git-core/git-gui\n> >\n> > (and I have $PATH set up to contain $bindir, but not $gitexecdir),\n> > and this\n> > needs the original hunk with the three [file dirname ... ], because\n> > $argv0\n> > points to $prefix/libexec/git-core/git-gui.\n>\n> The original hunk fixes the discovery of oguilib, i.e.\n> from $prefix/libexec/git-core/git-gui to $prefix/share/git-gui/lib\n>\n> I didn't recognize that the the 'three [file dinames ...]' have\n> not been applied because I had this change already in 4msysgit\n> (and still have).  Apologies for not checking this more carefully.\n>\n>\n> > I thought I understood what's going on, but I don't anymore.\n> >\n> > Mybe the relative discovery of oguilib must be conditional on the\n> > \"git-core\"\n> > part as well, just like you discover sharedir?\n>\n> Hmm... you are right.  If we want to maintain compatibility\n> with *both* directory layouts, obviously all computations\n> that depend on the layout need to be conditional on it.\n\nHere is a patch that does just this.\n\n-- Hannes\n\n git-gui/git-gui.sh |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex fd3875a..fa08d49 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -52,7 +52,11 @@ catch {rename send {}} ; # What an evil concept...\n set oguilib {@@GITGUI_LIBDIR@@}\n set oguirel {@@GITGUI_RELATIVE@@}\n if {$oguirel eq {1}} {\n-\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n+\tset oguilib [file dirname [file normalize $argv0]]\n+\tif {[lindex [file split $oguilib] end] eq {git-core}} {\n+\t\tset oguilib [file dirname $oguilib]\n+\t}\n+\tset oguilib [file dirname $oguilib]\n \tset oguilib [file join $oguilib share git-gui lib]\n \tset oguimsg [file join $oguilib msgs]\n } elseif {[string match @@* $oguirel]} {\n-- \n1.6.0.rc1.958.gce1ed\n"},{"id":"86221","messageId":"20080804200049.GA29485@spearce.org","threadId":"14706","inReplyTo":"1217879912.48975f6809e10@webmail.nextra.at","subject":"Re: [PATCH] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-08-04T20:00:49Z","receivedAt":"2008-08-04T20:00:49Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Sixt <johannes.sixt@telecom.at> wrote:\n> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n> index fd3875a..fa08d49 100755\n> --- a/git-gui/git-gui.sh\n> +++ b/git-gui/git-gui.sh\n> @@ -52,7 +52,11 @@ catch {rename send {}} ; # What an evil concept...\n>  set oguilib {@@GITGUI_LIBDIR@@}\n>  set oguirel {@@GITGUI_RELATIVE@@}\n>  if {$oguirel eq {1}} {\n> -\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n> +\tset oguilib [file dirname [file normalize $argv0]]\n> +\tif {[lindex [file split $oguilib] end] eq {git-core}} {\n> +\t\tset oguilib [file dirname $oguilib]\n\nIsn't that what [file tail] does?\n\n\tif {[file tail $oguilib] eq {git-core}} {\n\nBut otherwise this looks good to me.  I'll apply it later tonight,\nunless you agree that file tail is better here.\n\n-- \nShawn.\n"},{"id":"86222","messageId":"1217880586.4897620ad4e6a@webmail.nextra.at","threadId":"14706","inReplyTo":"20080804200049.GA29485@spearce.org","subject":"[PATCH v2] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2008-08-04T20:09:46Z","receivedAt":"2008-08-04T20:09:46Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The new execdir has is two levels below the root directory, while\nthe old execdir 'bin' was only one level below.  This commit\nadapts the discovery of oguilib that uses relative paths\naccordingly. We determine whether we have the extra level in the same\nway in which the Makefile defines sharedir, i.e. whether the last\ndirectory part is 'git-core'.\n\nInspired-by: Steffen Prohaska <prohaska@zib.de>\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n\nZitat von \"Shawn O. Pearce\" <spearce@spearce.org>:\n> Johannes Sixt <johannes.sixt@telecom.at> wrote:\n> > +\tif {[lindex [file split $oguilib] end] eq {git-core}} {\n>\n> Isn't that what [file tail] does?\n\nYes, it is. I missed it in the myriad of file's options. Here's the updated\nversion of the patch.\n\n-- Hannes\n\n git-gui/git-gui.sh |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex fd3875a..60f376d 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -52,7 +52,11 @@ catch {rename send {}} ; # What an evil concept...\n set oguilib {@@GITGUI_LIBDIR@@}\n set oguirel {@@GITGUI_RELATIVE@@}\n if {$oguirel eq {1}} {\n-\tset oguilib [file dirname [file dirname [file normalize $argv0]]]\n+\tset oguilib [file dirname [file normalize $argv0]]\n+\tif {[file tail $oguilib] eq {git-core}} {\n+\t\tset oguilib [file dirname $oguilib]\n+\t}\n+\tset oguilib [file dirname $oguilib]\n \tset oguilib [file join $oguilib share git-gui lib]\n \tset oguimsg [file join $oguilib msgs]\n } elseif {[string match @@* $oguirel]} {\n-- \n1.6.0.rc1.958.gb3893\n"}]}