From d09ed2fa446b7ba65d73222cdbc3a56ff349af2a Mon Sep 17 00:00:00 2001 From: nixon Date: Tue, 28 Jun 2011 16:44:14 -0500 Subject: [PATCH] provide a fetch-pull merge alternative add merge, rebase and do-nothing options to the fetch-pull command. i like being able to fetch a pull request by number, but sometimes i'd rather not have the rebase happen automatically. --- lib/commands/commands.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands/commands.rb b/lib/commands/commands.rb index 3671f5d9..ca1448ac 100644 --- a/lib/commands/commands.rb +++ b/lib/commands/commands.rb @@ -265,9 +265,9 @@ end end -desc "Fetch a specified pull request and rebase it to the current tip" -usage "github fetch-pull [pullRequestId]" -command :'fetch-pull' do |n| +desc "Fetch a pull request and possibly rebase or merge it to the current tip" +usage "github fetch-pull [pullRequestId] [rebase | merge]" +command :'fetch-pull' do |n,action| user, repo = nil,nil # figure out the user+repo name from git-remote git("remote -v").split("\n").each do |line| @@ -299,5 +299,5 @@ end pgit "fetch #{repo_url}.git #{head['ref']}:pull-#{n}" pgit "checkout pull-#{n}" - pgit "rebase #{tip}" + pgit "#{action} #{tip}" if ["rebase", "merge"].include?(action) end