Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Fix of pull requests #64

wants to merge 1 commit into from

1 participant


Pull request call does not work for me, so I do minimal fix and use APIv2. It is quite rought, as it allows only set title and comment - not issue. Also response is not parsed and just showed. Also it does not escape chracters for shell. But at least it works for me. Feel free to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 11, 2011
  1. @jreidinger

    try fix pull requests

    jreidinger authored
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 9 deletions.
  1. +8 −9 lib/commands/commands.rb
17 lib/commands/commands.rb
@@ -171,16 +171,15 @@
-desc "Generate the text for a pull request."
-usage "github pull-request [user] [branch]"
-command :'pull-request' do |user, branch|
+desc "Generate a pull request to target owner and branch."
+usage "github pull-request [user] [branch] [title] [initial comment]"
+command :'pull-request' do |user, branch, title, comment|
if helper.project
- die "Specify a user for the pull request" if user.nil?
- user, branch = user.split('/', 2) if branch.nil?
- branch ||= 'master'
- GitHub.invoke(:track, user) unless helper.tracking?(user)
- git_exec "request-pull #{user}/#{branch} #{helper.origin}"
+ puts "not enough arguments" if user.nil? || branch.nil? || title.nil? || comment.nil?
+ current_branch = sh "git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'"
+ sh "curl -F 'login=#{github_user}' -F 'token=#{github_token}' -d \"pull[base]=#{branch}\" -d \"pull[head]=#{github_user}:#{current_branch}\" -d \"pull[title]=#{title}\" -d \"pull[body]=#{comment}\"{user}/#{helper.project}"
+ else
+ puts "no project"
Something went wrong with that request. Please try again.