git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <johannes.sixt@telecom.at>
To: Steffen Prohaska <prohaska@zib.de>,
	"Shawn O. Pearce" <spearce@spearce.org>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'
Date: Mon,  4 Aug 2008 21:58:32 +0200	[thread overview]
Message-ID: <1217879912.48975f6809e10@webmail.nextra.at> (raw)
In-Reply-To: <58FBF585-377C-40A7-818E-6B47F8FD2EB8@zib.de>

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. We determine whether we have the extra level in the same
way in which the Makefile defines sharedir, i.e. whether the last
directory part is 'git-core'.

Inspired-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---

Zitat von Steffen Prohaska <prohaska@zib.de>:
>
> On Aug 3, 2008, at 11:35 AM, Johannes Sixt wrote:
> > I run git-gui effectivly with
> >
> >   wish $prefix/libexec/git-core/git-gui
> >
> > (and I have $PATH set up to contain $bindir, but not $gitexecdir),
> > and this
> > needs the original hunk with the three [file dirname ... ], because
> > $argv0
> > points to $prefix/libexec/git-core/git-gui.
>
> The original hunk fixes the discovery of oguilib, i.e.
> from $prefix/libexec/git-core/git-gui to $prefix/share/git-gui/lib
>
> I didn't recognize that the the 'three [file dinames ...]' have
> not been applied because I had this change already in 4msysgit
> (and still have).  Apologies for not checking this more carefully.
>
>
> > I thought I understood what's going on, but I don't anymore.
> >
> > Mybe the relative discovery of oguilib must be conditional on the
> > "git-core"
> > part as well, just like you discover sharedir?
>
> Hmm... you are right.  If we want to maintain compatibility
> with *both* directory layouts, obviously all computations
> that depend on the layout need to be conditional on it.

Here is a patch that does just this.

-- Hannes

 git-gui/git-gui.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index fd3875a..fa08d49 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -52,7 +52,11 @@ 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 normalize $argv0]]
+	if {[lindex [file split $oguilib] end] eq {git-core}} {
+		set oguilib [file dirname $oguilib]
+	}
+	set oguilib [file dirname $oguilib]
 	set oguilib [file join $oguilib share git-gui lib]
 	set oguimsg [file join $oguilib msgs]
 } elseif {[string match @@* $oguirel]} {
-- 
1.6.0.rc1.958.gce1ed

  reply	other threads:[~2008-08-04 19:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-27 16:49 [PATCH 0/3] git-gui (Windows): Adapt to new execdir 'libexec/git-core' Steffen Prohaska
2008-07-27 16:49 ` [PATCH 1/3] git-gui: Adapt discovery of oguilib to " Steffen Prohaska
2008-07-27 16:49   ` [PATCH 2/3] git-gui (Windows): Switch to relative discovery of oguilib Steffen Prohaska
2008-07-27 16:49     ` [PATCH 3/3] git-gui (Windows): Change wrapper to execdir 'libexec/git-core' Steffen Prohaska
2008-07-27 21:24   ` [PATCH 1/3] git-gui: Adapt discovery of oguilib " Shawn O. Pearce
2008-07-28  5:01     ` Steffen Prohaska
2008-07-30  5:25       ` Shawn O. Pearce
2008-07-30  5:39         ` Steffen Prohaska
2008-08-03  9:35       ` Johannes Sixt
2008-08-03 10:09         ` Steffen Prohaska
2008-08-04 19:58           ` Johannes Sixt [this message]
2008-08-04 20:00             ` [PATCH] " Shawn O. Pearce
2008-08-04 20:09               ` [PATCH v2] " Johannes Sixt

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1217879912.48975f6809e10@webmail.nextra.at \
    --to=johannes.sixt@telecom.at \
    --cc=git@vger.kernel.org \
    --cc=prohaska@zib.de \
    --cc=spearce@spearce.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).