Граф коммитов

80 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić f98928699d Add support for passing multiple `--message` options
This is for compatibility with git-commit(1)
2018-11-28 03:05:15 +01:00
Jonny Stoten 0dc077ac32 Use scissors to separate comments from PR messages
This allows PR templates to include markdown headers with '#'
2018-10-30 23:38:17 +01:00
Mislav Marohnić b0d94c827d `hub pull-request -r`: match requested teams by slug and not name 2018-10-30 11:18:01 +01:00
Mislav Marohnić 8030c3b6ac Stop requesting `thor-preview` in API requests
It wasn't necessary for github.com since December 2017.
2018-08-23 14:39:24 +02:00
Mislav Marohnić adcfd980d3 Avoid re-requesting reviewers in case of CODEOWNERS
Requesting a review via `hub pull-request -r foo` would print a
misleading error message that `foo` couldn't be requested for review in
case `foo` was already requested per CODEOWNERS.

Fixes #1840
2018-08-23 14:39:11 +02:00
Mislav Marohnić b3ef319bf5 Handle a slightly different HTTP 422 message format
This is to avoid a crash in Unmarshal. #1840
2018-08-22 18:19:16 +02:00
Mislav Marohnić a9bb733386 `pull-request --no-edit`: test case for no commits detected 2018-06-06 15:53:43 +02:00
Harald Nordgren 2628ba3471 Create '--no-edit' option for hub pull-request 2018-05-31 12:37:08 +02:00
Mislav Marohnić 87d54b1dc8 Avoid unnecessary trim space from issue/PR templates
Also, split the pull request template with two newlines in between for
compatibility with GitHub web interface.

Fixes #1714
2018-05-29 15:11:23 +02:00
Mislav Marohnić c75cd8000a Verify that `PULL_REQUEST_TEMPLATE` directory doesn't break things
Closes #1731
2018-05-29 14:41:04 +02:00
Mislav Marohnić 3d50725c2b Add test for stripping `Signed-off-by` line 2018-05-29 12:23:39 +02:00
venyii c8d2cc0247
Add milestone to pr by name instead of number 2018-03-16 00:28:06 +01:00
Mislav Marohnić 2e47a2d732 Fix PR template on a branch with a single commit
The commit body comes first, then template text. This is for
compatibility with GitHub web interface.

Fixes #1657
2018-01-23 16:26:34 +01:00
Mislav Marohnić f8663339b0 Enable team reviewers in `pull-request` 2018-01-19 14:47:06 +01:00
Mislav Marohnić e3ad4ef7e5 Fix requesting pull request reviewers
The expected HTTP status code is 201

Fixes #1463
2017-05-18 13:19:02 +02:00
Pepper Lebeck-Jobe 71fa8dad8f
Upgrade to Go 1.8
The only thing that has substansively changed is that Go 1.8 handles
redirect logic more safely than previous versions. This means we can
drop our special handling to avoid following redirects to other
domains. We were only doing that to protect against the possibility
of leaking auth headers. With Go 1.8, the auth headers are not
forwarded when following a redirect to another domain, so we don't
need our special handling any more.

As long as people are attempting to build with the Makefile, the new
check_go_version script should cause the build to stop if our
collaborators aren't using at least version 1.8 of go.
2017-05-11 13:24:04 +09:00
Mislav Marohnić 39bd77179d Opt into "black-cat-preview" for all API requests
This allows us to access extra functionality around PR reviews.
2017-04-24 17:45:05 +02:00
Tomas Varneckas 0fad51944f
Add support for review requests in pull-request command 2017-04-17 18:34:54 +03:00
Natalie Weizenbaum fb40cab7fd Add --set-upstream to git push commands.
This ensures that a branch pushed using "hub pull-request" has its
upstream branch set to the target of the push.
2016-12-07 13:47:46 -08:00
Mislav Marohnić 4a147e8c46 Introduce HUB_RETRY_TIMEOUT 2016-10-22 12:32:52 +02:00
Mislav Marohnić 2437c48e65 Automatically retry creating a PR after 422 on `--push`
Since `--push` has just created a new branch, there could be a slight
delay before GitHub registers it, and there's a possibility that a 422
would be returned for the "head" field. If that happens, retry the POST
a couple of times until it either succeeds or times out.
2016-10-22 12:10:00 +02:00
Mislav Marohnić d68e6e4a78 Cleanup style 2016-10-22 12:09:48 +02:00
Natalie Weizenbaum f5544ec9e6 Code review changes. 2016-10-20 13:56:13 -07:00
Natalie Weizenbaum 05d203934c Add a --push flag to hub pull-request.
This removes an extra step from the process of publishing a pull
request. It also gives the user a chance to back out of the entire
process by saving an empty pull request message.
2016-10-03 13:40:20 -07:00
Mislav Marohnić 1b0631c009 Cleanup in git branch & upstream handling in cukes 2016-09-12 10:00:14 +02:00
Mislav Marohnić 9750615433 Fix inferred `pull-request` head for usernames with capital letters
Fixes #1256
2016-09-09 00:32:08 +02:00
Mislav Marohnić 3ab56f59b5 Fix assigning labels/assignees without the other
The GitHub API doesn't seem to like receiving `"assignees": null`.

Fixes #1240
2016-09-08 23:27:32 +02:00
Mislav Marohnić 860c910419 Unify `-F <filename> -e` functionality between commands 2016-08-21 12:40:16 +02:00
Mislav Marohnić b5e6387111 Merge remote-tracking branch 'origin/master' into edit-message 2016-08-21 11:33:39 +02:00
Mislav Marohnić 5d6090207f Tweak whitespace in issue/PR template handling 2016-08-21 11:22:57 +02:00
Mislav Marohnić 19f9fa48da Merge pull request #1099 from github/revamp-issues
Revamp `hub issue` commands
2016-08-16 18:54:05 +02:00
Mislav Marohnić d2792baf73 Switch `pull-request` assignees and labels flags to `listFlag`
This allows accumulating values across repeated arguments.
2016-08-15 14:08:44 +02:00
Dylan Arbour ff0cf78c2d
Fix CreatePullRequest to expect 201 over 200
According to Github's API docs, creating a pull request should yield a
status code of 201 and not 200.

Closes #1226
2016-08-12 13:09:17 -04:00
Mislav Marohnić af72087bc7 Add support for multiple assignees 2016-08-10 11:44:38 +02:00
Mislav Marohnić 25a4dd061c Resolve owner name in PR `head` specification in case of redirects
When the repo that hosts the `head` for the PR is moved to another
owner, the `owner:branch` specification will be wrong and the GitHub API
will return HTTP 422.

This resolves the latest owner/name pair for head repo so that the value
is never stale when submitting new PR to be created.

Fixes #467
2016-08-09 22:07:33 +02:00
Mislav Marohnić 80606a5889 Follow 307 redirects in simpleApi, even for POST
HTTP client used to automatically follow GET redirects, or turn certain
POST redirects to GET when applicable, but for opening a new pull
request for a renamed repo, we need to repeat the POST against the
updated location.
2016-08-09 22:02:04 +02:00
Mislav Marohnić 56fce4bc6b Migrate PR creation to simpleApi 2016-08-09 22:02:04 +02:00
Mislav Marohnić 648f25cf2f Fix assigning user to pull request without labels
Fixes #1057
2016-01-20 13:46:59 +11:00
Madhusudan.C.S 90a4f3d7a9 Add a cucumber test to verify that pull-request works with fetch-only upstream remote. 2015-11-02 15:55:05 -08:00
David Calavera 2ab5c55589 Allow to set pull request milestone and labels.
Add the `-M/--milestone` and `-l/--labels` flags to `hub pull-request` to
set the milestone or tags when a pull request is created.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-08-05 14:29:51 -07:00
Justin Campbell 9b1ded19b3 Update EDITMSG copy 2015-07-08 12:59:40 -06:00
m_nakamura145 fd09d23bf2 Add -e option to pull request 2015-07-01 23:17:20 +09:00
Marko Mikulicic eb46b81c0c Address review comments:
- Add test for `pull-request -a`
- Narrow scope of `updateIssue` to `updateIssueAssignee`
2015-04-07 11:03:52 +02:00
Mislav Marohnić 00b846af46 Backport cukes from 1.12-stable branch 2014-12-24 20:20:28 -08:00
Jingwen Owen Ou 356173d4a4 Back port cukes from v1.12.3
v2.2.0 doesn’t have the bug bc4b450b61 but back porting the cukes in case there’ll be regression for v2.2.0.
2014-12-24 09:02:18 -08:00
Jingwen Owen Ou 3aeba67bad Treat remote URL user name case insensitive when creating PR
See https://github.com/github/hub/issues/685
2014-11-16 12:58:56 -08:00
Mislav Marohnić 44aefe7728 Fix git commit summary in pull request message template
Use "origin/<base>" and "origin/<head>" for git commit comparison and
summary in the pull request template instead of the local branch
equivalents, since the local branches could be out of date with the
remote tracking branches.
2014-10-19 23:41:45 +02:00
Mislav Marohnić a070963dff Use "text/template" instead of "html/" to not have HTML-escaping
Otherwise, characters like quotes, less/greater than signs, and
ampersand would get HTML-escaped in the text editor for the pull request
message.
2014-07-29 22:22:27 -07:00
Mislav Marohnić 5539949491 Merge remote-tracking branch 'origin/master' into cukes-master 2014-07-27 14:18:13 -07:00
Mislav Marohnić 2200d93788 Port remaining `pull-request` tests to cukes 2014-07-27 13:54:46 -07:00