Avoid keeping useless console windows for GUI tools.
commita3d688dcbc07f66ea323e0f5bcb54927cae07659
authorAlexander Gavrilov <angavrilov@gmail.com>
Mon, 15 Dec 2008 18:23:19 +0000 (15 21:23 +0300)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 16 Dec 2008 17:31:24 +0000 (16 18:31 +0100)
tree99356697236ea6b649d71c54a5099185aca89375
parent4a868f35fd73194b3b1c529f7b10562fe2129382
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>
cmd/git.cmd
cmd/gitk.cmd