Mislav Marohnić
b2e36a0979
Merge pull request #1706 from cli/base-resolve
...
Improve repository base and head resolution
2020-09-16 18:53:21 +02:00
Mislav Marohnić
f99a55438f
Remove issue create examples from pr create
2020-09-16 15:48:13 +02:00
Mislav Marohnić
f9239661f2
Reuse the StubRepoInfoReponse test helper
2020-09-16 15:01:13 +02:00
Mislav Marohnić
7a8db80420
Prompt for push target during pr create
...
We no longer guess the head repository using heuristics; instead, we
present the user with the choice of pushable repositories and an
additional option to create a new fork.
The new `pr create --head` flag is available for the user to specify the
head branch in `branch` or `owner:branch` format and completely skip any
forking or auto-pushing checks.
2020-09-16 14:49:36 +02:00
Mislav Marohnić
d534a94d1b
Change how base repository is resolved
...
On first run in a git repository, `BaseRepo()` will now prompt the user
which repository should be queried as base repository if there are
multiple git remotes or when we are in the context of a fork.
In non-interactive mode, the prompt is skipped and we default to the
first git remote instead.
After the base repo is resolved, the result is cached in the local
repository using `git config` so that RepositoryNetwork API lookups can
be avoided in the future.
2020-09-15 21:27:12 +02:00
Mislav Marohnić
6ad6784c46
Ignore EPIPE when forwarding pr diff output to pager
2020-09-14 15:30:10 +02:00
Mislav Marohnić
b2e7f0c1e2
Merge remote-tracking branch 'origin' into pager-for-everyone
2020-09-14 14:18:42 +02:00
vilmibm
1073c97409
review feedback
2020-09-11 11:36:24 -05:00
vilmibm
c0fc31f7d5
use CanPrompt in commands
2020-09-10 12:13:48 -05:00
Nate Smith
33e11f02e4
Merge pull request #1611 from dhleong/dhleong/pr-prepend-commit-bodies
...
Prepend PR body defaults to the selected template (if any)
2020-09-09 16:57:27 -05:00
Mislav Marohnić
9040f6adc6
Fix view tests
2020-09-09 17:40:04 +02:00
Mislav Marohnić
fda9659e4a
Consistently print browsed URL across commands
2020-09-09 17:02:02 +02:00
Daniel Leong
c7e702203b
Update template test to reflect inclusion of "default" text
...
Also, avoid excessive amounts of newlines separating the two
2020-09-08 20:25:52 -04:00
Daniel Leong
41543b564d
"Check" the error value of ioutil.WriteFile
...
We could, alternatively, use t.Fatal... this matches the MkdirAll
invocation from github_template_test, however...
2020-09-08 20:12:28 -04:00
Daniel Leong
a33124414c
Add a test to verify the behavior of prepending commit body to message
2020-09-08 20:12:28 -04:00
Daniel Leong
c4227455e3
Prepend PR body defaults to the selected template (if any)
...
See #1570
2020-09-08 20:12:28 -04:00
Nate Smith
74614b13da
Merge pull request #1627 from giacomoalbe/add-commit-headline-to-pr-merge
...
Add PR Title to CommitHeadline during merge PR
2020-09-08 17:05:26 -05:00
Nate Smith
c2d7cbf51f
Merge pull request #1582 from AliabbasMerchant/interactiveCreationTests
...
Interactive template selection test for issue create
2020-09-08 16:55:04 -05:00
Mislav Marohnić
d77a8c2e61
Scope pr merge commit headline to only squash method
2020-09-07 22:27:27 +02:00
Mislav Marohnić
ccfe38de26
Add PAGER support to commands that produce significant output
2020-09-04 23:36:14 +02:00
Mislav Marohnić
d01355e24b
Add global PAGER support
...
Extract the ad-hoc PAGER behavior from `pr diff` command and make it
available opt-in to any command through IOStreams.
2020-09-04 23:07:17 +02:00
vilmibm
eb132a1ae6
Merge remote-tracking branch 'origin/trunk' into checks
2020-09-03 14:48:32 -05:00
vilmibm
2961c655fb
review feedback
2020-09-02 11:33:39 -05:00
AliabbasMerchant
9e7279604d
Fix failing tests for Windows (due to line-ending issues)
2020-09-02 10:03:56 +05:30
AliabbasMerchant
51c5595cad
Interactive template selection test for PR create
2020-09-02 09:56:28 +05:30
Mislav Marohnić
766e4950d9
Be transparent about which part of pr create flow failed
...
When applying metadata to the new PR such as assignees or reviewers, if
the operation fails, an error message would get printed:
failed to create pull request: <API error text>
This was misleading, because the PR did get created; it's just that
updating it failed. The new error message is:
https://github.com/OWNER/REPO/pull/123
pull request update failed: <API error text>
The PR URL is printed on stdout and the error message is printed on
stderr. In case of any errors, the exit code is still non-zero.
2020-08-31 16:46:22 +02:00
vilmibm
8dd93e1748
gh pr checks
...
A basic first pass on gh pr checks that shows all check runs for a given
PR's latest commit.
2020-08-28 13:18:59 -05:00
Mislav Marohnić
c21caf5b2b
Disallow pr -R flag for commands that operate on the current branch
...
If the `--repo` flag is specified, then the user intends to select a
repository other than the current one. In that case, it doesn't make
sense to fall back to detecting the PR belonging to the current branch,
so throw a descriptive error instead.
2020-08-27 16:30:34 +02:00
Dan Hughes
7b8d052f0e
Add new output to existing test
2020-08-26 17:31:13 +01:00
Dan Hughes
a3aea11e5b
Include URL and number in non-TTY output
2020-08-26 17:28:17 +01:00
Nate Smith
b9292f582f
Merge pull request #1476 from rimazk123/prclose-delete
...
Add delete branch flag to pr close
2020-08-19 21:11:48 -05:00
vilmibm
e44eb665a1
Merge remote-tracking branch 'origin/trunk' into prclose-delete
2020-08-19 21:06:04 -05:00
Nate Smith
ddfa1714d2
Merge pull request #1479 from wilso199/pr-checkout-submodules
...
PR Checkout - Recurse Submodules
2020-08-19 16:46:21 -05:00
vilmibm
16f69e9c12
fix tests
2020-08-19 16:40:13 -05:00
vilmibm
5c4f93ad0a
Merge remote-tracking branch 'origin/trunk' into pr-checkout-submodules
2020-08-19 16:37:01 -05:00
Martín Montes
df66a8f131
Using default pager in gh pr diff
2020-08-17 22:31:30 +02:00
Mislav Marohnić
47cef736f4
Fix GH_REPO override
2020-08-07 14:47:58 +02:00
Mislav Marohnić
c00fe73d5a
Isolate issue commands
2020-08-07 00:27:55 +02:00
Mislav Marohnić
6490d7717c
Fix --repo override taking effect for pr commands
2020-08-06 21:39:46 +02:00
Mislav Marohnić
5404fb2362
Wrap up migrating all pr commands
2020-08-06 21:21:35 +02:00
Mislav Marohnić
82661c197e
Isolate pr list command
2020-08-04 18:38:06 +02:00
Mislav Marohnić
558e3f3dea
Isolate pr create command
2020-08-04 18:29:42 +02:00
Mislav Marohnić
e024184c6f
Fix pr merge test
2020-08-04 15:13:36 +02:00
Mislav Marohnić
d774a6a35f
Merge branch 'pr-commands-isolate' into pr-commands-isolate-2
2020-08-04 15:13:33 +02:00
Mislav Marohnić
8cba134f5d
Fix pr checkout test
2020-08-04 15:10:44 +02:00
Mislav Marohnić
a73584db72
Merge remote-tracking branch 'origin' into pr-commands-isolate
2020-08-04 15:01:30 +02:00
Mislav Marohnić
3ac73297eb
Isolate pr status command
2020-07-31 19:07:30 +02:00
Mislav Marohnić
7cc74c5bb6
Isolate pr merge command
2020-07-31 19:07:16 +02:00
Mislav Marohnić
74b191d0f7
Isolate pr view command
2020-07-31 14:19:09 +02:00
Mislav Marohnić
7949d5373d
Fix pr diff in notty mode
2020-07-29 22:58:08 +02:00