@matheusbsbs / matheus-bagliano / commits / cd12901b8f
Fork 0

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>

Shawn O. Pearce committed May 28, 2007 at 11:22 UTC cd12901b8f247bfcec161d5de658dae6c8185691
1 file changed +18 -14
git-gui.sh
+18 -14
@@ -20,6 +20,24 @@ You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA}
22
23 +######################################################################
24 +##
25 +## enable verbose loading?
26 +
27 +if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
28 + unset _verbose
29 + rename auto_load real__auto_load
30 + proc auto_load {name args} {
31 + puts stderr "auto_load $name"
32 + return [uplevel 1 real__auto_load $name $args]
33 + }
34 + rename source real__source
35 + proc source {name} {
36 + puts stderr "source $name"
37 + uplevel 1 real__source $name
38 + }
39 +}
40 +
41 ######################################################################
42 ##
43 ## configure our library
@@ -61,20 +79,6 @@ if {$idx ne {}} {
79 }
80 unset -nocomplain oguirel idx fd
81
64 -if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
65 - unset _verbose
66 - rename auto_load real__auto_load
67 - proc auto_load {name args} {
68 - puts stderr "auto_load $name"
69 - return [uplevel 1 real__auto_load $name $args]
70 - }
71 - rename source real__source
72 - proc source {name} {
73 - puts stderr "source $name"
74 - uplevel 1 real__source $name
75 - }
76 -}
77 -
82 ######################################################################
83 ##
84 ## read only globals