git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [msysGit] [GIT GUI PATCH] git-gui: fix open explorer window on Windows 7

From
Pat Thoyts <patthoyts@googlemail.com>
Date
Feb 25, 2010, 22:49 UTC
Message-ID
<a5b261831002251449r7ac437f3h478727764ac755eb@mail.gmail.com>
In-Reply-To
<201002252323.13240.markus.heidelberg@web.de>
On 25 February 2010 22:23, Markus Heidelberg <markus.heidelberg@web.de> wrote:
Show 21 quoted lines
> Heiko Voigt, 2010-02-25 21:30:
>> On Wed, Feb 24, 2010 at 12:15:03PM +0000, Pat Thoyts wrote:
>> > On 23 February 2010 22:52, Heiko Voigt <hvoigt@hvoigt.net> wrote:
>> > > It seems that Windows 7's explorer is not capable to cope with paths
>> > > that contain forward slashes as path seperator. We thus substitute slash
>> > > with the platforms native backslash.
>> > >
>> >
>> > What bug are you actually addressing here? How can I reproduce it? My
>> > experience on Windows 7 is that there is no problem but I assume I'm
>> > doing a different operation. If I use the git-gui  "Explore working
>> > copy" it opens the Windows explorer for me just fine.
>>
>> Very strange, again another inconsistency between Windowses? I can
>> reproduce this even on Windows XP. I am using the current devel branches
>> of msysgit (msysgit and git). It happens when using the
>> "Repository->Explore working copy" menu item. The Windows 7 I tested
>> this on is 32-bit Professional. Which Windows 7 are you using?
>
> You should tell, how exactly you start git-gui, because this makes the
> difference in this bug.

I have Windows 7 64 bit Ultimate - but I doubt the version of Win7 is going to matter here.

In my case, using the current release of msysGit (1.6.5.1.1367.gcd48) can launch the Windows explorer and so can the current devel branch of msysgit. I launch these from the windows cmd shell using the scripts in msysgit\cmd\ for the devel version

But lets be real certain we are runing the script in the msysgit\git\git-gui directory:

C:\src\msysgit\git\git-gui>set PATH=c:\src\msysgit\bin;c:\src\msysgit\mingw\bin;%PATH% C:\src\msysgit\git\git-gui>tclkit86 git-gui.sh

This is now guaranteed running the script mentioned and it uses the 'lib' subfolder from this directory too. Help About says git-gui version @@GITGUI_VERSION@@ and git version 1.7.0.rc2.1441.g8e037 as I built and installed this a few days ago.

However, I notice that it is not actually browsing the working folder when it launches the browser - it has actually opened "My Documents". I presume this is the bug you intend to fix -- and applying your patch confirms that it solves this issue.

Can you please give enough information in the commit message to let us know what issue is being solved by the changes provided.

To avoid any confusion I confirm the following patch ensures that exploring the working folder on Windows correctly opens the working folder of the current repository.

Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net>
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index cd8da37..82c352b 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2099,15 +2099,17 @@ proc do_git_gui {} {
 proc do_explore {} {
        global _gitworktree
        set explorer {}
+       set path $_gitworktree
        if {[is_Cygwin] || [is_Windows]} {
                set explorer "explorer.exe"
+               set path [list [file nativename $path]]
        } elseif {[is_MacOSX]} {
                set explorer "open"
        } else {
                # freedesktop.org-conforming system is our best shot
                set explorer "xdg-open"
        }
-       eval exec $explorer $_gitworktree &
+       eval exec $explorer $path &
 }

 set is_quitting 0
Previous: Markus Heidelberg
Message 13 of 13 in “git-gui: fix open explorer window on Windows 7”
  1. git-gui: fix open explorer window on Windows 7Heiko Voigt, Feb 23, 2010
  2. Markus HeidelbergFeb 24, 2010
  3. Giuseppe BilottaFeb 24, 2010
  4. Pat ThoytsFeb 24, 2010
  5. git-gui: fix "Explore Working Copy" for Windows againMarkus Heidelberg, Feb 25, 2010
  6. Heiko VoigtFeb 25, 2010
  7. Pat ThoytsFeb 25, 2010
  8. Johannes SchindelinFeb 26, 2010
  9. Heiko VoigtFeb 27, 2010
  10. Pat ThoytsFeb 24, 2010
  11. Heiko VoigtFeb 25, 2010
  12. Markus HeidelbergFeb 25, 2010
  13. Pat ThoytsFeb 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.