Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 48 lines (43 sloc) 1.355 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
def git_task(name, cmd = nil)
  cmd ||= yield if block_given?
  cmd ||= name
  desc "git #{name} for %s"
  project_task(name) do
    puts '', '#'*80, "# #{subproject.name}"
    if File.exist? subproject.name then system "cd #{subproject.name}; git #{cmd}; cd .."
    else $stderr.puts "# missing"
    end
  end
end

def commit
  "commit -a -m #{ENV['message'].to_s.inspect}"
end

def tag
  "tag -a #{ENV['tag'].to_s.inspect} -m #{ENV['tag'].to_s.inspect}"
end

namespace :git do
  namespace :big_band do
    task(:header) { puts '', '#'*80, "# BigBand" }
    task(:status => :header) { system "git status" }
    task(:pull => :header) { system "git pull --no-ff" }
    task(:push => :header) { system "git push" }
    task(:diff => :header) { system "git diff" }
    task(:tags => :header) { system "git push --tags" }
    task(:commit => :header) { system "git #{commit}" }
    task(:tag => :header) { system "git #{tag}" }
  end
  task :status => "big_band:status"
  task :pull => "big_band:pull"
  task :push => "big_band:push"
  task :diff => "big_band:diff"
  task :tags => "big_band:tags"
end

project_namespace :git do
  git_task :status
  git_task :pull, "pull --no-ff"
  git_task :push
  git_task :diff
  git_task :tags, "push --tags"
  git_task(:commit) { commit }
  git_task(:tag) { tag }
end
Something went wrong with that request. Please try again.