]> git.ipfire.org Git - thirdparty/git.git/commit
git-gui: Test for Cygwin differently than from Windows.
authorShawn O. Pearce <spearce@spearce.org>
Mon, 29 Jan 2007 01:58:47 +0000 (20:58 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 29 Jan 2007 06:12:42 +0000 (01:12 -0500)
commit20ddfcaa7e7f91816f1195a2dbb1b5268fd71e3d
treedc52cd0a0ac48e9292193b279cdd6d80b7e09cf1
parent273984fc4f26ab92aa8ebf5b033b9cdb56322b71
git-gui: Test for Cygwin differently than from Windows.

Running on Cygwin is different than if we were running through MinGW.

In the Cygwin case we have cygpath available to us, we need to perform
UNIX<->Windows path translation sometimes, and we need to perform odd
things like spawning our own login shells to perform network operations.
But in the MinGW case these don't occur.  Git knows native Windows file
paths, and login shells may not even exist.

Now git-gui will avoid running cygpath unless it knows its on Cygwin.
It also uses a different shortcut type when Cygwin is not present, and
it avoids invoking /bin/sh to execute hooks if Cygwin is not present.
This latter part probably needs more testing in the MinGW case.

This change also improves how we start gitk.  If the user is on any type
of Windows system its known that gitk won't start right if ~/.gitk exists.
So we delete it before starting if we are running on any type of Windows
operating system.  We always use the same wish executable which launched
git-gui to start gitk; this way on Windows we don't have to jump back to
/bin/sh just to go into the first wish found in the user's PATH.  This
should help on MinGW when we probably don't want to spawn a shell just
to start gitk.

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