Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Commands/Use SourceTree.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
require ENV['TM_BUNDLE_SUPPORT'] + '/environment.rb'
dispatch(:controller =&gt; "misc", :action =&gt; "stree")
</string>
<key>input</key>
<string>none</string>
<key>inputFormat</key>
<string>text</string>
<key>name</key>
<string>Visualize History with SourceTree</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>text</string>
<key>outputLocation</key>
<string>discard</string>
<key>scope</key>
<string>attr.scm.git</string>
<key>semanticClass</key>
<string>action.scm.other</string>
<key>uuid</key>
<string>283B9B2C-5F38-11E1-8D49-6F3A4F0E19BB</string>
<key>version</key>
<string>2</string>
</dict>
</plist>
13 changes: 12 additions & 1 deletion Support/app/controllers/misc_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ def gitx
output_show_tool_tip
end
end


def stree
cmd = first_which(git.config["git-tmbundle.stree-path"], "stree", "/Applications/SourceTree.app/Contents/Resources/stree")
if cmd
rootdir = git.path()
run_detached("cd '#{rootdir}';" + cmd, "SourceTree")
else
puts "Unable to find SourceTree. Use the config dialog to set the SourceTree path to where you've installed it."
output_show_tool_tip
end
end

protected
def first_which(*args)
args.map do |arg|
Expand Down
1 change: 1 addition & 0 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<string>1FF5FF82-13A0-4C83-BAD6-D67AE8180FA9</string>
<string>1C12DE42-78A9-4DCA-BB55-2B8E6328C72D</string>
<string>D0DF4B19-F311-48CC-BF68-F8B33CD051D3</string>
<string>283B9B2C-5F38-11E1-8D49-6F3A4F0E19BB</string>
<string>------------------------------------</string>
<string>5A08145A-069F-4196-8F32-07C05EF4DCB6</string>
<string>------------------------------------</string>
Expand Down