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

Re: [PATCH] git-gui: add mingw specific startup wrapper

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 10, 2007, 06:22 UTC
Message-ID
<20071010062218.GP2137@spearce.org>
In-Reply-To
<11919958073204-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> wrote:
Show 8 quoted lines
> The wrapper adds the directory it is installed in to PATH.
> This is required for the git commands implemented in shell.
> git-gui fails to launch them if PATH is not modified.
> 
> The wrapper script also accepts an optional command line
> switch '--working-dir <dir>' and changes to <dir> before
> launching the actual git-gui. This is required to implement
> the "Git Gui Here" Explorer shell extension.
 
Nice.
Show 7 quoted lines
> diff --git a/git-gui/Makefile b/git-gui/Makefile
> @@ -128,6 +128,7 @@ ifeq ($(uname_S),Darwin)
>  endif
>  ifneq (,$(findstring MINGW,$(uname_S)))
>  	NO_MSGFMT=1
> +	GITGUI_WINDOWS_WRAPPER := YesPlease
>  endif

I don't have this context in my Makefile so I can't apply this additional line here. Can someone package up the patch that introduces the MINGW case above with a proper commit message, so I can apply it in front of this patch?

Show 11 quoted lines
>  install: all
> @@ -246,6 +257,9 @@ ifdef GITGUI_MACOSXAPP
>  	$(QUIET)$(INSTALL_A0)'Git Gui.app' $(INSTALL_A1) '$(DESTDIR_SQ)$(libdir_SQ)'
>  	$(QUIET)$(INSTALL_X0)git-gui.tcl $(INSTALL_X1) '$(DESTDIR_SQ)$(libdir_SQ)'
>  endif
> +ifdef GITGUI_WINDOWS_WRAPPER
> +	$(QUIET)$(INSTALL_X0)git-gui.tcl $(INSTALL_X1) '$(DESTDIR_SQ)$(libdir_SQ)'
> +endif
>  	$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
>  	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
>  	$(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
I think you missed the entry in the uninstall and clean targets.
Show 11 quoted lines
> diff --git a/git-gui/windows/git-gui.sh b/git-gui/windows/git-gui.sh
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +# Tcl ignores the next line -*- tcl -*- \
> +exec wish "$0" -- "$@"
> +
> +if { $argc >=2 && [lindex $argv 0] == "--working-dir" } {
> +	cd [lindex $argv 1]
> +	set argv [lrange $argv 2 end]
> +	incr argc -2
> +}

Maybe we should just support this option directly in git-gui. Today we also support doing something like this by setting the GIT_DIR environment variable into a non-bare repository; see the "# repository setup" block of git-gui.sh.

Show 6 quoted lines
> +set gitguidir [file dirname [info script]]
> +regsub -all ";" $gitguidir "\\;" gitguidir
> +set env(PATH) "$gitguidir;$env(PATH)"
> +unset gitguidir
> +
> +source [file join [file dirname [info script]] git-gui.tcl]

Hmmph. The install target was going into libdir but the above source doesn't seem to read from there, its loading from the same location as the git-gui wrapper script. You msys guys probably don't have $(libdir) == $(gitexecdir), do you?

-- 
Shawn.
Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 2 of 11 in “git-gui: add mingw specific startup wrapper”
  1. git-gui: add mingw specific startup wrapperSteffen Prohaska, Oct 10, 2007
  2. Shawn O. PearceOct 10, 2007
  3. Steffen ProhaskaOct 10, 2007
  4. git-gui: set NO_MSGFMT to force using pure tcl replacement in msysgitSteffen Prohaska, Oct 10, 2007
  5. git-gui: add mingw specific startup wrapperSteffen Prohaska, Oct 10, 2007
  6. Shawn O. PearceOct 10, 2007
  7. Johannes SchindelinOct 10, 2007
  8. Steffen ProhaskaOct 10, 2007
  9. Johannes SchindelinOct 10, 2007
  10. Steffen ProhaskaOct 10, 2007
  11. Johannes SchindelinOct 10, 2007

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.