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

Droppable Git Gui in Mac OS X

From
TCTobia Conforto <tobia.conforto@gmail.com>
Date
Aug 7, 2009, 10:12 UTC
Message-ID
<loom.20090807T090458-788@post.gmane.org>
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 }
Next: Shawn O. Pearce
Message 1 of 2 in “Droppable Git Gui in Mac OS X”
  1. Tobia ConfortoAug 7, 2009
  2. Shawn O. PearceAug 10, 2009

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.