Permalink
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (35 sloc) 1.34 KB
<?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'
require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist'
git = Git.new
path = File.expand_path('..', git.git_dir(git.paths.first))
branches = git.branch.list(:all)
parameters = { "branches" =&gt; branches.map { |e| { "name" =&gt; e[:name] } } }
token = open('|"$DIALOG" -a CompareBranches', 'r+') { |io| io &lt;&lt; parameters.to_plist; io.close_write; io.read.chomp }
res = open('|"$DIALOG" -w' + token) { |io| OSX::PropertyList.load(io) }
open('|"$DIALOG" -x' + token) { |io| }
if res &amp;&amp; res['returnArgument']
parent = res['returnArgument'].first['name']
current = res['currentBranch'].first['name']
dispatch(:controller =&gt; "diff", :action =&gt; "diff", :branches =&gt; [parent, current])
end
</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>^G</string>
<key>name</key>
<string>Compare Branches…</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
<string>E56D4990-B615-4788-A46C-5D0CDE750D56</string>
</dict>
</plist>