From: Shawn O. Pearce <spearce@spearce.org>
Date: Mon, 28 May 2007 15:22:13 +0000 (-0400)
Subject: git-gui: Enable verbose Tcl loading earlier
X-Git-Tag: v1.5.3-rc0~118^2~12
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd12901b8f247bfcec161d5de658dae6c8185691;p=git

git-gui: Enable verbose Tcl loading earlier

When we are using our "non-optimized" tclIndex format (which is
just a list of filenames, in the order necessary for source'ing)
we are doing all of our loading before we even tested to see if
GITGUI_VERBOSE was set in the environment.  This meant we never
showed the files as we sourced them into the environment.

Now we setup our overloaded auto_load and source scripts before
we attempt to define our library path, or source the scripts that
it mentions.  This way GITGUI_VERBOSE is always honored if set.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---

diff --git a/git-gui.sh b/git-gui.sh
index c1a6b84fa4..6608116339 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -20,6 +20,24 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA}
 
+######################################################################
+##
+## enable verbose loading?
+
+if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
+	unset _verbose
+	rename auto_load real__auto_load
+	proc auto_load {name args} {
+		puts stderr "auto_load $name"
+		return [uplevel 1 real__auto_load $name $args]
+	}
+	rename source real__source
+	proc source {name} {
+		puts stderr "source    $name"
+		uplevel 1 real__source $name
+	}
+}
+
 ######################################################################
 ##
 ## configure our library
@@ -61,20 +79,6 @@ if {$idx ne {}} {
 }
 unset -nocomplain oguirel idx fd
 
-if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
-	unset _verbose
-	rename auto_load real__auto_load
-	proc auto_load {name args} {
-		puts stderr "auto_load $name"
-		return [uplevel 1 real__auto_load $name $args]
-	}
-	rename source real__source
-	proc source {name} {
-		puts stderr "source    $name"
-		uplevel 1 real__source $name
-	}
-}
-
 ######################################################################
 ##
 ## read only globals