Skip to content

This rake task allows you to include SVN externals in a GIT repo using an .svn_externals in the same format as the svn:externals property, and load/update these externals when necessary.

Notifications You must be signed in to change notification settings

lkosak/Subversion-Externals-Rake-Task-for-GIT-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Subversion Externals Rake Task for GIT users

Synopsis

This is a simple Rake task that I created when I moved the central repository of a large project from subversion to Git. While Git modules could potentially afford some of the same behavior as svn:externals, anyone who’s researched them knows that they don’t REALLY serve the same purpose. Furthermore, the external dependencies for my project are still hosted on subversion.

This Might Be Useful To You If:

  • You have a Git repository that depends on external subversion repositories

  • You have Ruby installed in all the environments that your code is run

  • You are comfortable with the extra step of running “rake externals:update” when cloning your repository

  • You have a deployment process that can be updated to include the running of “rake externals:update” each time your code is published (in my case, using Capistrano for deployment, this was as easy as adding the code below to my deploy.rb file)

Installation

  1. Add Rakefile to your project’s root directory (or insert the content of Rakefile into your existing Rakefile)

  2. Create an .svn_externals file in your project’s root directory. This file should be in the same format as The subversion property :svn_externals, e.g.:

relative/path/to/target/directory svn+ssh://your.svn.repository/url

  1. Add the target directory to your project root’s .gitignore file

$> cat .gitignore
relative/path/to/target/directory
$>
  1. Load your externals!

$> rake externals:update

Capistrano deployment hook:

namespace :deploy do
  before "deploy:symlink" do
    run("cd #{release_path}; rake externals:init")
  end
end

LICENSE:

(The MIT License)

Copyright © 2009 Lou Kosak

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

This rake task allows you to include SVN externals in a GIT repo using an .svn_externals in the same format as the svn:externals property, and load/update these externals when necessary.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published