TextMate News

Anything vaguely related to TextMate and macOS.

Git Bundle

You may have read that a lot of prominent people have recently moved to Git and are loving it. I too am one of those who fancy this new kid on the block but never got very far with the bundle I started for it.

Fortunately Tim Harper recently picked up on my initial efforts and has done a great job at not only making this bundle functional but also downright impressive :)

The much improved Git bundle can be found at Gitorious and discussion about it can be directed to its Google Group.

For those too lazy to click the link above, here are the short install instructions:

mkdir -p /Library/Application\ Support/TextMate/Bundles
cd !$
git clone git://gitorious.org/git-tmbundle/mainline.git Git.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

After having installed it you can press ⌃⌘T in TextMate and enter git to find the “Administration → Update Git Bundle” action. Use this to update the bundle (it will automatically reload after having performed the update).

categories General

47 Comments

There is a nice Mercurial bundle as well, but it’s in the TextMate subversion repo so you need svn to get it - oh, the irony! :)

http://svn.textmate.org/trunk/Bundles/Mercurial.tmbundle/

[…] Git Bundle - TextMate bindings for the new sexy source control system. With prominent projects moving to Git, I probably should figure this stuff out. […]

21 February 2008

by Chris Rohde

Hmm, after updating git bundle all the options are grayed out. Did you get a different result?

Chris: do you have a file open in the editor? Most bundles are only active when one or more files are being edited…

21 February 2008

by Chris Rohde

Ben: thanks, had the app open, but hadn’t selected a file. Its early, still on the first mountain dew.

I have Git installed and installed the bundle also. But when I try to update I get:

/tmp/temp_textmate.Fw1Xhs:6: command not found: git pull

Someone else also have this?

This was just what I needed, thanks!

@Petar: I didn’t get any errors when updating the bundle, might be a problem with your installation of git.

I figured out the problem. My git was located in: /usr/local/bin

I hade to make a link to it in my /usr/bin with ln -s. After that everything worked.

I’ve pushed an update to “polish up” the update bundle command. It should fix your problem. If not, try setting the TM_GIT environment variable under the TextMate preferences dialog to point to “/usr/local/bin/git”

That’d be much preferred over the symlink fix.

I’m pleased that all are enjoying the git bundle.

Tim

Tim, thanks for this - I’m very impressed with this bundle.

I too still have to set the TM_GIT variable to get it to find git, even though /usr/local/bin is in PATH when I run a shell script from TextMate. This is with commit 583ed4ec, the latest at this time.

There is a nice Mercurial bundle as well, but it’s in the TextMate subversion repo so you need svn to get it - oh, the irony! :

Fair enough. ;) You can take a look at the mercurial repo of the bundle here. And now you can:

mkdir -p /Library/Applications\ Support/TextMate/Bundles 
cd !$
hg clone http://mercurial.intuxication.org/hg/mercurial-tmbundle Mercurial.tmbundle
osascript -e 'tell app "TextMate" to reload bundles'

Awesome! I’ve been waiting for this for a while.

Hi, do the git commands work across multiple sub-directories? I installed the bundle and opened up a Rails app, but it only seemed to work for the files in the root directory where the .git is located. Is this by design? or am i missing something? Thank you!

For me it works for all files in a project if I open the folder that contains the .git files in Textmate. If I open a single file further down the tree, I get all kinds of errors.

Doesn’t bother me, since the first way is the way I work anyway :)

Thanks for this post, it inspired me to try out git and it’s absolutely perfect for what I’m doing.

[…] I first heard about distributed version control systems from Allan Odgaard on the TextMate blog. […]

05 March 2008

by Rob Hudson

Cool! When will it be added to http://svn.textmate.org/trunk/Bundles?

10 March 2008

by Rob Cowie

Any plans to add patch commands to the bundle?

cheers :)

04 April 2008

by Jaremy Creechley

After installing the Git bundle and it doesn’t seem to appear. I had a previous Git bundle installed which is I deleted. A Haskell bundle installed in the same location is found. I am unsure what to do or how to figure out what is different.

Thanks

13 April 2008

by Fredrik Friele

This is what I get when trying to update, even though I can ping the host.

Updating git bundle

gitorious.org[0: 67.207.146.32]: errno=Host is down fatal: unable to connect a socket (Host is down)

17 June 2008

by Daniel

How do I suggest to the author of Mercurial bundle to add tag support???

[…] And of course, TextMate support: Git Bundle […]

I’m trying to push to a remote ssh server that prompts for a password every time. Is there a way to configure TM to know the password? It doesn’t prompt me, it just says “permission denied” right now.

[…] Ikuti aja dari sini biasanya pasti langsung jalan deh. […]

[…] a good TextMate bundle to support Git, but to be honest I’ve mostly used the […]

this is great but… how do I add/rm files to the git project (I mean the equivalent of “git add somefile”)?

02 December 2008

by theIntuitonist

A really great feature would be to place the branch name in the title bar along with the project name. I forget to switch branches from time to time, a problem i’ve solved on the command line by changing my command prompt to list branch name along with directory when in a git repo.

Thanks for the copy and paste instructions :)

Hmm, I’m not sure what to make of this. When I click Commit, it brings up a dialog box saying “Choose files to commit:” that includes the current Python file I’m working on “factor_graph.py” and (unhelpfully) the associated “factor_graph.pyc”, but for some reason there seems to be no way to also commit “factor_graph_test.py” at the same time. There should be some way to commit multiple source files at once.

Here is my replacement for the commit command that does what I was hoping. I’m sure you can do a better version of it, so let’s call this version 0:

result=$(CocoaDialog textbox –title “Commit” \ –editable \ –informative-text “Message:” \ –button1 “Okay” –button2 “Cancel”)

num_part=$(head -n1 <<<“$result”) message=$(tail -n1 <<<“$result”) [[$num_part == “2”]] && exit_discard

echo “$message” git commit -a -F - pre

I’m a bit confused. Keeping in mind I’m a total git newb, I ran git init on my rails app folder, did the initial add via git add . and then opened the project in textmate. The bundle works correctly and seems to pick up changes, but how in the hell do I get it to add new files?! I just have a question mark beside them.

YK: Click the check box next to the files you wish to add, to include them in the commit.

Ha! I thought I had tried that but apparently not. I think I was confused because the question mark remains, unlike subversion which replaces the question mark with an A when it realizes you’re adding a new file. Anyway, it worked, but seems like this bundle still needs some finessing. I also laughed when it texted me to add .gitignore to my repository. :) Cheers.

22 September 2009

by Troex Nevelin

Looks like it have problems when git colors are set to “always”, especially with git config color.diff

[…] just recently had this problem and saw that the answer was buried in a TextMate blog entry comment […]

I pulled down the git bundle and when I ran the osascript command I received the following error:

dko-macpro:Bundles derik$ osascript -e ‘tell app “TextMate” to reload bundles’ 2009-10-31 21:58:23.260 osascript[8592:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework - scripting addition “/Library/ScriptingAdditions/Adobe Unit Types.osax” declares no loadable handlers. dko-macpro:Bundles derik$ osascript -e ‘tell app “TextMate” to reload bundles’ 2009-10-31 21:58:41.197 osascript[8598:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework - scripting addition “/Library/ScriptingAdditions/Adobe Unit Types.osax” declares no loadable handlers.

Whenever I tried to run the git bundle update I receive the following errors:

2009-10-31 22:09:20.282 osascript[8744:613] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper osascript: OpenScripting.framework - scripting addition “/Library/ScriptingAdditions/Adobe Unit Types.osax” declares no loadable handlers. Already up-to-date.

Whenever I try to commit the macro hangs… any idea what could be going on? I set TM_GIT to /usr/local/git/bin/git (that’s where which tells me it is)

that fixed the first issue but the git bundle update still errors out and the macro still hangs any time I try to commit.

gish: If you installed your own 64 bit ruby then that might make the commit window hang (this is also mentioned on the page I linked to).

If the update still gives same error, then the OSAScript extension must still be there.

That said, blog comments are not suitable for support like this. Please write the mailing list or support if you have further problems, but also do checkout the troubleshooting section.

Love the plugin! Awesome!

However, since upgrading to Snow Leopard, when I select a file in textmate and ctrl-shift-g and then select log, I always get a blank set of log entries.

The log on the whole project works fine however.

I got a colleague who also moved up to snow leopard to test this, and he got the same. Also got someone who did NOT upgrade, and his single file log entries were fine.

Is it just us, are we going mad?

Dan: Presumably the output from git log on Snow Leopard for single files is somehow changed and breaks the log parser in the Git bundle.

Presently not on Snow Leopard so can’t easily test. Best way to report this would be the Google Group linked to in the blog post — or if you have enough info to pinpoint the bug, the issue tracker.

[…] dass sich der Funktionsumfang durch Bundles schier endlos erweitern lässt. So auch mit einem Git-Bundle, das ermöglicht direkt aus TextMate heraus eine Vielzahl von Git-Kommandos auszuführen und eine […]