Avoid keeping useless console windows for GUI tools.
While msysgit supports running its commands from the Windows
command line, contrary to the expectations of many users the
GUI tools block the console, as they do in Linux.
Moreover, if the command is started from a GUI application,
like Start/Run or Total Commander, a useless empty console
window appears. This happens because the actual GUI executable
is started through a set of console wrapper processes, which
cause the window to be created and kept around as they wait
for the program to complete.
This patch aims to minimize negative effects of this issue by
tweaking wrapper scripts that are used to start Git from the
native Windows command line. This change does not affect core
Git code and behavior of the Git Bash interface, which is likely
to be used by people with Linux background. On the other hand,
users who prefer Windows command line will get behavior that
they are accustomed to.
The main idea is to start the GUI interpreter directly from the
script, bypassing all intermediate wrappers, and return without
waiting. Since wish.exe does not use the console, it immediately
disappears, reducing clutter on the screen.
Supporting 'git gui' requires looking at the arguments of the
'git' script. I make the 'git gui ...' command nonblocking,
but preserve the original behavior for 'git citool ...' aka
'git gui citool ...', because it has a meaningful return code.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>