]> git.ipfire.org Git - thirdparty/git.git/commit - git-gui/git-gui.sh
git-gui - use cygstart to browse on Cygwin
authorMark Levedahl <mlevedahl@gmail.com>
Mon, 26 Jun 2023 16:53:04 +0000 (12:53 -0400)
committerPratyush Yadav <me@yadavpratyush.com>
Thu, 24 Aug 2023 14:19:57 +0000 (16:19 +0200)
commit4ed23c3c928bdafb2efb9912d6f9e3039ca1ea03
tree062b7ea702890e662fcb3f0daea3b0abd83f195f
parent7145c654fffecd1f3d4a2b8bf05755ce262903e8
git-gui - use cygstart to browse on Cygwin

git-gui enables the "Repository->Explore Working Copy" menu on Cygwin,
offering to open a Windows graphical file browser at the root of the
working directory. This code, shared with Git For Windows support,
depends upon use of Windows pathnames. However, git gui on Cygwin uses
unix pathnames, so this shared code will not work on Cygwin.

A base install of Cygwin provides the /bin/cygstart utility that runs
a registered Windows application based upon the file type, after
translating unix pathnames to Windows.  Adding the --explore option
guarantees that the Windows file explorer is opened, regardless of the
supplied pathname's file type and avoiding possibility of some other
action being taken.

So, teach git-gui to use cygstart --explore on Cygwin, restoring the
pre-2012 behavior of opening a Windows file explorer for browsing. This
separates the Git For Windows and Cygwin code paths. Note that
is_Windows is never true on Cygwin, and is_Cygwin is never true on Git
for Windows, though this is not obvious by examining the code for those
independent functions.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
git-gui.sh