Skip to content

Commit

Permalink
Update feature.rb with new Git::run_safe
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbeardsley committed Mar 16, 2012
1 parent 748e835 commit 6db03ac
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions feature.rb
Expand Up @@ -11,12 +11,14 @@


exit if !confirm("Create feaure branch named: '#{feature}' ?") exit if !confirm("Create feaure branch named: '#{feature}' ?")


Git::run_safe("git branch \"#{feature}\" master") Git::run_safe([
Git::run_safe("git checkout \"#{feature}\"") "git branch \"#{feature}\" master",
# Automatically setup remote tracking branch "git checkout \"#{feature}\"",
Git::run_safe("git config branch.#{feature}.remote origin") # Automatically setup remote tracking branch
Git::run_safe("git config branch.#{feature}.merge refs/heads/#{feature}") "git config branch.#{feature}.remote origin",
Git::run_safe("git config branch.#{feature}.rebase true") "git config branch.#{feature}.merge refs/heads/#{feature}",
"git config branch.#{feature}.rebase true"
])


puts "Successfully created a new feature-branch: #{feature}" puts "Successfully created a new feature-branch: #{feature}"


Expand Down Expand Up @@ -63,17 +65,20 @@


exit 1 if !confirm("Finish feaure branch named: '#{feature}' ?") exit 1 if !confirm("Finish feaure branch named: '#{feature}' ?")


Git::run_safe("git checkout master") commands = [
# pull the latest changes and rebase the unpushed master commits if any. "git checkout master",
Git::run_safe("git pull --rebase") # pull the latest changes and rebase the unpushed master commits if any.
# merge the feature branch into master "git pull --rebase",
Git::run_safe("git merge --no-ff \"#{feature}\"") # merge the feature branch into master
# delete the local feature-branch "git merge --no-ff \"#{feature}\"",
Git::run_safe("git branch -d \"#{feature}\"") # delete the local feature-branch
# delete the remote branch we'll leave this off for now "git branch -d \"#{feature}\"",
# Git::run_safe("git push origin :\"#{feature}\"") # delete the remote branch we'll leave this off for now
# push the the merge to our origin #"git push origin :\"#{feature}\"",
# Git::run_safe("git push origin") # push the the merge to our origin
#"git push origin",
]
Git::run_safe(commands)


puts "Successfully merged feature-branch: #{feature} into master" puts "Successfully merged feature-branch: #{feature} into master"


Expand Down

0 comments on commit 6db03ac

Please sign in to comment.