git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Droppable Git Gui in Mac OS X
@ 2009-08-07 10:12 Tobia Conforto
  2009-08-10 15:26 ` Shawn O. Pearce
  0 siblings, 1 reply; 2+ messages in thread
From: Tobia Conforto @ 2009-08-07 10:12 UTC (permalink / raw)
  To: git

Hello

I'm using Git 1.6.3.3 on Mac OS X 10.5.7, installed using MacPorts 1.710

I noticed that Git Gui cannot be launched on an existing repository by
simply dragging the repository folder onto Git Gui's icon in the dock,
but this is a standard UI feature in OS X.

Here is a fix "Git Gui.app" (which MacPorts installs in
/opt/local/share/git-gui/lib) to enable this feature.

The change to Info.plist enables dropping folders onto the application.
The modified AppMain.tcl, before launching the application, receives the
one pending OpenDocument event and cd's to the repository folder.

-Tobia


--- Git Gui.app/Contents/Info.plist
+++ Git Gui.app/Contents/Info.plist
@@ -24,5 +24,16 @@
 	<string>GITg</string>
 	<key>CFBundleVersion</key>
 	<string>0.12.0</string>
+	<key>CFBundleDocumentTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeOSTypes</key>
+			<array>
+				<string>fold</string>
+			</array>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+		</dict>
+	</array>
 </dict>
 </plist>
--- Git Gui.app/Contents/Resources/Scripts/AppMain.tcl
+++ Git Gui.app/Contents/Resources/Scripts/AppMain.tcl
@@ -19,4 +19,9 @@

 unset gitexecdir gitguilib
 set argv [lrange $argv 1 end]
-source $AppMain_source
+
+proc ::tk::mac::OpenDocument {args} {
+	cd [lindex $args 0]
+}
+
+after 1 { source $AppMain_source }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Droppable Git Gui in Mac OS X
  2009-08-07 10:12 Droppable Git Gui in Mac OS X Tobia Conforto
@ 2009-08-10 15:26 ` Shawn O. Pearce
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2009-08-10 15:26 UTC (permalink / raw)
  To: Tobia Conforto; +Cc: git

Tobia Conforto <tobia.conforto@gmail.com> wrote:
> I noticed that Git Gui cannot be launched on an existing repository by
> simply dragging the repository folder onto Git Gui's icon in the dock,
> but this is a standard UI feature in OS X.
> 
> Here is a fix "Git Gui.app" (which MacPorts installs in
> /opt/local/share/git-gui/lib) to enable this feature.

Interesting.

Two comments:

1) Commit message?  What should we record in the project history
   for this change?

2) Signed-off-by line?  Please see git.git's SUBMITTING_PATCHES
   file for details of what this means, and why it is necessary:

   http://repo.or.cz/w/alt-git.git?a=blob;f=Documentation/SubmittingPatches;hb=HEAD

 
> --- Git Gui.app/Contents/Info.plist
> +++ Git Gui.app/Contents/Info.plist
> @@ -24,5 +24,16 @@
>  	<string>GITg</string>
>  	<key>CFBundleVersion</key>
>  	<string>0.12.0</string>
> +	<key>CFBundleDocumentTypes</key>
> +	<array>
> +		<dict>
> +			<key>CFBundleTypeOSTypes</key>
> +			<array>
> +				<string>fold</string>
> +			</array>
> +			<key>CFBundleTypeRole</key>
> +			<string>Viewer</string>
> +		</dict>
> +	</array>
>  </dict>
>  </plist>
> --- Git Gui.app/Contents/Resources/Scripts/AppMain.tcl
> +++ Git Gui.app/Contents/Resources/Scripts/AppMain.tcl
> @@ -19,4 +19,9 @@
> 
>  unset gitexecdir gitguilib
>  set argv [lrange $argv 1 end]
> -source $AppMain_source
> +
> +proc ::tk::mac::OpenDocument {args} {
> +	cd [lindex $args 0]
> +}
> +
> +after 1 { source $AppMain_source }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Shawn.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-10 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 10:12 Droppable Git Gui in Mac OS X Tobia Conforto
2009-08-10 15:26 ` Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).