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

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

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Feb 24, 2010, 00:14 UTC
Message-ID
<201002240114.11634.markus.heidelberg@web.de>
In-Reply-To
<20100223225243.GC11271@book.hvoigt.net>
Heiko Voigt, 2010-02-23 23:52:
Show 21 quoted lines
> 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.
> 
> Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
> ---
>  git-gui/git-gui.sh |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 9a9525d..ae45a12 100644
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -2112,15 +2112,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 [string map {/ \\} $path]]

I remember having had the same problem, which I fixed with [file nativename]. See commit 454efb47b (git-gui (Win): make "Explore Working Copy" more robust). But that was on XP, shouldn't be Windows 7 specific. So why does it fail now again, although I had fixed it? ...

Show 8 quoted lines
>  	} 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 &

Ah, this doesn't look like what it looked like back then. Commit 21985a113 (git-gui: handle non-standard worktree locations) changed it, removing the [file nativename]. I don't know if this was by accident, but there is another place, where it was changed in a different manner:

Compare
-       eval exec $explorer [list [file nativename [file dirname [gitdir]]]] &
+       eval exec $explorer $_gitworktree &
with

-wm title . "[appname] ([reponame]) [file normalize [file dirname [gitdir]]]" +wm title . "[appname] ([reponame]) [file normalize $_gitworktree]"

Maybe _gitworktree should be normalized or nativenamified when it is set and then will work everywhere it is used for every platform?

Markus
Previous: Heiko VoigtNext: Giuseppe Bilotta
Message 2 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.