dotfiles/vcs/git/gitconfig.merge

24 lines
803 B
Plaintext
Raw Normal View History

# vim: set ft=gitconfig noexpandtab ts=2 sw=2
[merge]
summary = true
tool = opendiff
# http://bitfission.com/blog/2010/07/auto-merge-gemfile-lock.html
[merge "bundlelock"]
name = lock Gemfile
driver = "bundle check && bundle install"
# http://tbaggery.com/2010/10/24/reduce-your-rails-schema-conflicts.html
[merge "railsschema"]
name = newer Rails schema version
driver = "ruby -e '\n\
system %(git), %(merge-file), %(--marker-size=%L), %(%A), %(%O), %(%B)\n\
b = File.read(%(%A))\n\
b.sub!(/^<+ .*\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n=+\\nActiveRecord::Schema\\.define.:version => (\\d+). do\\n>+ .*/) do\n\
%(ActiveRecord::Schema.define(:version => #{[$1, $2].max}) do)\n\
end\n\
File.open(%(%A), %(w)) {|f| f.write(b)}\n\
exit 1 if b.include?(%(<)*%L)'"