DebuggingGitkOrGitGui - wnoguchi/msysgit GitHub Wiki
Due to certain limitations of Windows (such as command line length), Git for Windows has more issues than other platforms. This is especially bad when the window just flashes (i.e. opens and closes right away) without giving the user a hint as to what happened.
This page tries to help debugging such issues.
If you define the procedure backTrace
as follows, you can call it anywhere to see in which order functions were called to get here (where "here" means wherever you input a call to the procedure):
for {set i 1} {<} {incr i} { puts ": [info level -]" } }
Of course, on Windows you might want to call console show
somewhere before, otherwise you will not see anything :-)
A tip to debug git gui: Add
console show
right after exec wish in ''INSTALLATION''ROOT/libexec/git-core/git-gui.tcl
or in /git/git-gui/git-gui.sh
. If you do it in the latter file do not forget to make install
from inside /git/git-gui
. This opens a tcl console whenever you start git gui
and you can interact with the full tcl/tk power during runtime. You can adapt this technique to debug gitk
.
There is a trace feature build into git gui you can enable it from the tcl console with set _trace 1
or pass the commandline option --trace
when starting git-gui.
When you have problems with gitk or git gui, the first thing to do is to call them from Git Bash or Git Cmd, as the error messages and warnings are printed to the console which you would not see otherwise.
Since Tcl/Tk 8.4, there is a trace option, which you can use in combination with the fact that in Tcl, you can override the proc operator, which defines functions (this tip comes from the Tcl/Tk Wiki):
rename proc _proc _proc proc {name arglist body} { uplevel 1 [list _proc ] uplevel 1 [list trace add execution enterstep [list ::proc_start ]] } _proc proc_start {name command op} { puts " >> " }
As with execution traces, you can also override the set operator, which sets variables (this tip comes also from the Tcl/Tk Wiki):
rename set _set proc set {var args} { puts [list set ] uplevel _set }