Permalink
Browse files

Update feature.rb with new Git::run_safe

  • Loading branch information...
1 parent 748e835 commit 6db03acbf650e0bef350b4c55b25de8679928bbb @danielbeardsley danielbeardsley committed Mar 16, 2012
Showing with 22 additions and 17 deletions.
  1. +22 −17 feature.rb
View
@@ -11,12 +11,14 @@
exit if !confirm("Create feaure branch named: '#{feature}' ?")
- Git::run_safe("git branch \"#{feature}\" master")
- Git::run_safe("git checkout \"#{feature}\"")
- # Automatically setup remote tracking branch
- Git::run_safe("git config branch.#{feature}.remote origin")
- Git::run_safe("git config branch.#{feature}.merge refs/heads/#{feature}")
- Git::run_safe("git config branch.#{feature}.rebase true")
+ Git::run_safe([
+ "git branch \"#{feature}\" master",
+ "git checkout \"#{feature}\"",
+ # Automatically setup remote tracking branch
+ "git config branch.#{feature}.remote origin",
+ "git config branch.#{feature}.merge refs/heads/#{feature}",
+ "git config branch.#{feature}.rebase true"
+ ])
puts "Successfully created a new feature-branch: #{feature}"
@@ -63,17 +65,20 @@
exit 1 if !confirm("Finish feaure branch named: '#{feature}' ?")
- Git::run_safe("git checkout master")
- # pull the latest changes and rebase the unpushed master commits if any.
- Git::run_safe("git pull --rebase")
- # merge the feature branch into master
- Git::run_safe("git merge --no-ff \"#{feature}\"")
- # delete the local feature-branch
- Git::run_safe("git branch -d \"#{feature}\"")
- # delete the remote branch we'll leave this off for now
- # Git::run_safe("git push origin :\"#{feature}\"")
- # push the the merge to our origin
- # Git::run_safe("git push origin")
+ commands = [
+ "git checkout master",
+ # pull the latest changes and rebase the unpushed master commits if any.
+ "git pull --rebase",
+ # merge the feature branch into master
+ "git merge --no-ff \"#{feature}\"",
+ # delete the local feature-branch
+ "git branch -d \"#{feature}\"",
+ # delete the remote branch we'll leave this off for now
+ #"git push origin :\"#{feature}\"",
+ # push the the merge to our origin
+ #"git push origin",
+ ]
+ Git::run_safe(commands)
puts "Successfully merged feature-branch: #{feature} into master"

0 comments on commit 6db03ac

Please sign in to comment.