Skip to content

Commit 4f70dd1

Browse files
committed
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.
1 parent 5e130ac commit 4f70dd1

6 files changed

Lines changed: 21 additions & 19 deletions

File tree

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,6 @@ superpowers:
232232
# explicit title, pull base & head:
233233
$ git pull-request -m "Implemented feature X" -b defunkt:master -h mislav:feature
234234

235-
$ git pull-request -i 123
236-
[ attached pull request to issue #123 ]
237-
238235
### git checkout
239236

240237
$ git checkout https://github.com/defunkt/hub/pull/73

features/pull_request.feature

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,11 @@ Feature: hub pull-request
342342
}
343343
"""
344344
When I successfully run `hub pull-request -i 92`
345-
Then the output should contain exactly "https://github.com/mislav/coral/pull/92\n"
345+
Then the output should contain exactly:
346+
"""
347+
https://github.com/mislav/coral/pull/92
348+
Warning: Issue to pull request conversion is deprecated and might not work in the future.\n
349+
"""
346350

347351
Scenario: Convert issue URL to pull request
348352
Given I am on the "feature" branch with upstream "origin/feature"
@@ -354,7 +358,11 @@ Feature: hub pull-request
354358
}
355359
"""
356360
When I successfully run `hub pull-request https://github.com/mislav/coral/issues/92`
357-
Then the output should contain exactly "https://github.com/mislav/coral/pull/92\n"
361+
Then the output should contain exactly:
362+
"""
363+
https://github.com/mislav/coral/pull/92
364+
Warning: Issue to pull request conversion is deprecated and might not work in the future.\n
365+
"""
358366

359367
Scenario: Enterprise host
360368
Given the "origin" remote has url "git@git.my.org:mislav/coral.git"

lib/hub/commands.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def ci_status(args)
115115

116116
# $ hub pull-request
117117
# $ hub pull-request "My humble contribution"
118-
# $ hub pull-request -i 92
119118
# $ hub pull-request https://github.com/rtomayko/tilt/issues/92
120119
def pull_request(args)
121120
args.shift
@@ -173,6 +172,10 @@ def pull_request(args)
173172
end
174173
end
175174

175+
if options[:issue]
176+
warn "Warning: Issue to pull request conversion is deprecated and might not work in the future."
177+
end
178+
176179
options[:project] = base_project
177180
options[:base] ||= master_branch.short_name
178181

man/hub.1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Opens a pull request on GitHub for the project that the "origin" remote points t
152152
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\.
153153
.
154154
.IP
155-
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\.
155+
Issue to pull request conversion via \fB\-i <ISSUE>\fR or \fIISSUE\-URL\fR arguments is deprecated and will likely be removed from the future versions of both hub and GitHub API\.
156156
.
157157
.TP
158158
\fBgit ci\-status\fR [\fB\-v\fR] [\fICOMMIT\fR]
@@ -313,9 +313,6 @@ $ git pull\-request
313313

314314
# explicit title, pull base & head:
315315
$ git pull\-request \-m "Implemented feature X" \-b defunkt:master \-h mislav:feature
316-
317-
$ git pull\-request \-i 123
318-
[ attached pull request to issue #123 ]
319316
.
320317
.fi
321318
.

man/hub.1.html

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/hub.1.ronn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ hub also adds some custom commands that are otherwise not present in git:
151151
of the pull request can be entered in the same manner as git commit message.
152152
Pull request message can also be passed via stdin with `-F -`.
153153

154-
If instead of normal <TITLE> an issue number is given with `-i`, the pull
155-
request will be attached to an existing GitHub issue. Alternatively, instead
156-
of title you can paste a full URL to an issue on GitHub.
154+
Issue to pull request conversion via `-i <ISSUE>` or <ISSUE-URL>
155+
arguments is deprecated and will likely be removed from the future versions
156+
of both hub and GitHub API.
157157

158158
* `git ci-status` [`-v`] [<COMMIT>]:
159159
Looks up the SHA for <COMMIT> in GitHub Status API and displays the latest

0 commit comments

Comments
 (0)