Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

74 lines (60 sloc) 1.94 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
# Resolve conflicts command for git/FileMerge
# By Tim Harper
# http://code.leadmediapartners.com/
require "fileutils"
FM="/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge"
require ENV['TM_BUNDLE_SUPPORT'] + '/environment.rb'
require ENV['TM_SUPPORT_PATH'] + '/lib/escape.rb'
state = :both
input_file_path = ENV['TM_FILEPATH']
input_filename = File.basename(input_file_path)
input = $&lt;.read
left = ""
right = ""
input.each { |line|
if /^(&lt;{7}|={7}|&gt;{7})($| )/.match(line)
state =
case $1
when "&lt;&lt;&lt;&lt;&lt;&lt;&lt;" then :left
when "=======" then :right
when "&gt;&gt;&gt;&gt;&gt;&gt;&gt;" then :both
end
next
end
left &lt;&lt; line if state == :left || state == :both
right &lt;&lt; line if state == :right || state == :both
}
if left==right
puts "No conflicts to resolve in #{input_file_path}."
exit
end
filename = "git-conflict-resolve"
tmp_path = "/tmp/git-conflict-resolve/"
FileUtils.rm_rf(tmp_path)
FileUtils.mkdir_p(tmp_path)
left_file = "#{tmp_path}left-#{input_filename}.rb"
right_file = "#{tmp_path}right-#{input_filename}.rb"
File.open(left_file, "w") { |f| f.puts left }
File.open(right_file, "w") { |f| f.puts right }
%x{#{FM} -left #{e_sh left_file} -right #{e_sh right_file} -merge #{e_sh input_file_path} &amp;&gt;/dev/null &amp; }
</string>
<key>input</key>
<string>document</string>
<key>keyEquivalent</key>
<string>^G</string>
<key>name</key>
<string>Edit Conflicts With FileMerge…</string>
<key>output</key>
<string>showAsTooltip</string>
<key>uuid</key>
<string>7CE2C842-EBC4-443C-8DDB-3B16AC593D9A</string>
</dict>
</plist>
Jump to Line
Something went wrong with that request. Please try again.