From 4f70dd126f46dec14fc341c97c18efae417743c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sat, 21 Dec 2013 14:46:23 +0100 Subject: [PATCH] Deprecate converting issue to pull-request This feature is likely to get dropped from GitHub API in the near future. The alternative is to simply create a new pull-request and reference the original issue in the description. --- README.md | 3 --- features/pull_request.feature | 12 ++++++++++-- lib/hub/commands.rb | 5 ++++- man/hub.1 | 5 +---- man/hub.1.html | 9 +++------ man/hub.1.ronn | 6 +++--- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f62f36a17..ff8f17589 100644 --- a/README.md +++ b/README.md @@ -232,9 +232,6 @@ superpowers: # explicit title, pull base & head: $ git pull-request -m "Implemented feature X" -b defunkt:master -h mislav:feature - $ git pull-request -i 123 - [ attached pull request to issue #123 ] - ### git checkout $ git checkout https://github.com/defunkt/hub/pull/73 diff --git a/features/pull_request.feature b/features/pull_request.feature index cea18145e..7f4c7af1f 100644 --- a/features/pull_request.feature +++ b/features/pull_request.feature @@ -342,7 +342,11 @@ Feature: hub pull-request } """ When I successfully run `hub pull-request -i 92` - Then the output should contain exactly "https://github.com/mislav/coral/pull/92\n" + Then the output should contain exactly: + """ + https://github.com/mislav/coral/pull/92 + Warning: Issue to pull request conversion is deprecated and might not work in the future.\n + """ Scenario: Convert issue URL to pull request Given I am on the "feature" branch with upstream "origin/feature" @@ -354,7 +358,11 @@ Feature: hub pull-request } """ When I successfully run `hub pull-request https://github.com/mislav/coral/issues/92` - Then the output should contain exactly "https://github.com/mislav/coral/pull/92\n" + Then the output should contain exactly: + """ + https://github.com/mislav/coral/pull/92 + Warning: Issue to pull request conversion is deprecated and might not work in the future.\n + """ Scenario: Enterprise host Given the "origin" remote has url "git@git.my.org:mislav/coral.git" diff --git a/lib/hub/commands.rb b/lib/hub/commands.rb index 24b32cbfb..a80b1af8a 100644 --- a/lib/hub/commands.rb +++ b/lib/hub/commands.rb @@ -115,7 +115,6 @@ def ci_status(args) # $ hub pull-request # $ hub pull-request "My humble contribution" - # $ hub pull-request -i 92 # $ hub pull-request https://github.com/rtomayko/tilt/issues/92 def pull_request(args) args.shift @@ -173,6 +172,10 @@ def pull_request(args) end end + if options[:issue] + warn "Warning: Issue to pull request conversion is deprecated and might not work in the future." + end + options[:project] = base_project options[:base] ||= master_branch.short_name diff --git a/man/hub.1 b/man/hub.1 index 07fc79af0..2de064e90 100644 --- a/man/hub.1 +++ b/man/hub.1 @@ -152,7 +152,7 @@ Opens a pull request on GitHub for the project that the "origin" remote points t Without \fIMESSAGE\fR or \fIFILE\fR, a text editor will open in which title and body of the pull request can be entered in the same manner as git commit message\. Pull request message can also be passed via stdin with \fB\-F \-\fR\. . .IP -If instead of normal \fITITLE\fR an issue number is given with \fB\-i\fR, the pull request will be attached to an existing GitHub issue\. Alternatively, instead of title you can paste a full URL to an issue on GitHub\. +Issue to pull request conversion via \fB\-i \fR or \fIISSUE\-URL\fR arguments is deprecated and will likely be removed from the future versions of both hub and GitHub API\. . .TP \fBgit ci\-status\fR [\fB\-v\fR] [\fICOMMIT\fR] @@ -313,9 +313,6 @@ $ git pull\-request # explicit title, pull base & head: $ git pull\-request \-m "Implemented feature X" \-b defunkt:master \-h mislav:feature - -$ git pull\-request \-i 123 -[ attached pull request to issue #123 ] . .fi . diff --git a/man/hub.1.html b/man/hub.1.html index 845b8de9a..8f30f58b5 100644 --- a/man/hub.1.html +++ b/man/hub.1.html @@ -192,9 +192,9 @@

DESCRIPTION

of the pull request can be entered in the same manner as git commit message. Pull request message can also be passed via stdin with -F -.

-

If instead of normal TITLE an issue number is given with -i, the pull -request will be attached to an existing GitHub issue. Alternatively, instead -of title you can paste a full URL to an issue on GitHub.

+

Issue to pull request conversion via -i <ISSUE> or ISSUE-URL +arguments is deprecated and will likely be removed from the future versions +of both hub and GitHub API.

git ci-status [-v] [COMMIT]

Looks up the SHA for COMMIT in GitHub Status API and displays the latest status. Exits with one of:
success (0), error (1), failure (1), pending (2), no status (3)

@@ -319,9 +319,6 @@

git pull-request

# explicit title, pull base & head: $ git pull-request -m "Implemented feature X" -b defunkt:master -h mislav:feature - -$ git pull-request -i 123 -[ attached pull request to issue #123 ]

git checkout

diff --git a/man/hub.1.ronn b/man/hub.1.ronn index 6491dc9fb..bccfe6941 100644 --- a/man/hub.1.ronn +++ b/man/hub.1.ronn @@ -151,9 +151,9 @@ hub also adds some custom commands that are otherwise not present in git: of the pull request can be entered in the same manner as git commit message. Pull request message can also be passed via stdin with `-F -`. - If instead of normal an issue number is given with `-i`, the pull - request will be attached to an existing GitHub issue. Alternatively, instead - of title you can paste a full URL to an issue on GitHub. + Issue to pull request conversion via `-i <ISSUE>` or <ISSUE-URL> + arguments is deprecated and will likely be removed from the future versions + of both hub and GitHub API. * `git ci-status` [`-v`] [<COMMIT>]: Looks up the SHA for <COMMIT> in GitHub Status API and displays the latest