Commit graph

95 commits

Author SHA1 Message Date
Mislav Marohnić
4662abb312 Merge remote-tracking branch 'origin' into fix-incorrect-docs 2020-06-16 17:08:10 +02:00
Mislav Marohnić
3fea249d70 💅 tweak issue/pr create examples 2020-06-16 16:43:05 +02:00
Mislav Marohnić
b838ac4014 Improve no args error handler and extend it to other commands 2020-06-15 21:01:32 +02:00
Eddú Meléndez Gonzales
c70756d596
Improve message when draft pr is created (#1202)
Fixes #1199

Co-authored-by: Mislav Marohnić <mislav@github.com>
2020-06-15 15:27:30 +02:00
AliabbasMerchant
84f3d46338 Better example section in issue and pr create 2020-06-14 21:53:56 +05:30
Aliabbas Merchant
4d84e4696a
Reverse the order of commits in pr create --fill (#1144) 2020-06-10 12:56:26 +02:00
Mislav Marohnić
e19ea12265 Merge remote-tracking branch 'origin' into blank-issue 2020-06-10 12:35:33 +02:00
AliabbasMerchant
4749e91c53 Use cobra Example field for issue & PR create examples 2020-06-10 09:55:19 +05:30
AliabbasMerchant
a775562379 Added Examples for Issue and PR Create 2020-06-09 23:42:24 +05:30
AliabbasMerchant
5b9e64b485 Fix incorrect docs in Issue&PR create 2020-05-26 08:00:51 +05:30
AliabbasMerchant
e910c039f0 Return error when it occurs 2020-05-26 07:50:59 +05:30
AliabbasMerchant
f95b8916f3 Use url package for setting query params 2020-05-26 07:45:14 +05:30
AliabbasMerchant
42edd42da1 Undo unnecessary renames 2020-05-26 07:10:28 +05:30
AliabbasMerchant
5fc722fbb8 Query Params in Web mode of Issue/PR creation 2020-05-23 14:40:49 +05:30
AliabbasMerchant
8bfc935860 Fix Incorrect Template Type 2020-05-23 01:05:27 +05:30
AliabbasMerchant
4fd051b21d Issue/PR template selection flow mirrors that of GitHub 2020-05-23 00:25:13 +05:30
AliabbasMerchant
864d74d0b1 Categorize Templates as Legacy and NonLegacy 2020-05-23 00:03:38 +05:30
AliabbasMerchant
6effcd4261 Allow choosing a blank issue/pr template 2020-05-18 00:37:28 +05:30
Mislav Marohnić
386a53c34a Fix metadata resolver query 2020-05-12 16:48:30 +02:00
Mislav Marohnić
00f23b8d86 Store milestones as slice for consistency with other metadata
This is for code simplicity. Only 1 milestone per issue or PR is
allowed, like before.
2020-05-12 15:48:59 +02:00
Mislav Marohnić
6d57f2a91e Faster resolve GraphQL node IDs for assignees, reviewers, and labels 2020-05-12 15:33:51 +02:00
Mislav Marohnić
1128439cd1 issue/pr create: hide "Add metadata" if viewer does not have triage permission 2020-05-08 18:37:08 +02:00
Mislav Marohnić
d7e6d21766 Order projects, teams, and labels by name 2020-05-08 18:22:14 +02:00
Mislav Marohnić
34fc3457d6 Skip interactive mode in pr create if title & body were passed
This matches `issue create` behavior 4b32e3f215
2020-05-08 18:06:05 +02:00
Mislav Marohnić
716036161b Rename titleBody (now a misnomer) to something more descriptive 2020-05-08 17:55:46 +02:00
Mislav Marohnić
aeb08529e7 Add wizard that prompts for issue/pr metadata on create 2020-04-27 18:58:25 +02:00
Mislav Marohnić
90c8e0e967 Merge remote-tracking branch 'origin/master' into issue-pr-create-metadata 2020-04-27 14:17:09 +02:00
Mislav Marohnić
42baf4c8c5 Support org projects and team reviewers 2020-04-27 14:09:05 +02:00
vilmibm
bec58ede98 respect ssh
this adds recognition of the git_protocol setting when:

- creating a repo
- cloning a repo
- forking a repo
- forking/pushing during pr create
- checking out a PR

additionally, it:

- consolidates remote adding to use AddRemote; this introduces a fetch
where there previously hadn't been one
- changes repo clone to accept an ssh url
- changes repo fork to accept an ssh url

i just added basic unit tests; adding new test cases for all of the
above scenarios seemed like diminishing returns.
2020-04-22 14:21:01 -05:00
Mislav Marohnić
a7d061709d Add ability to prefetch granulated repository metadata 2020-04-21 19:14:57 +02:00
Mislav Marohnić
d3a89b8744 Expand issue create metadata flags to pr create
- Includes support `pr create --reviewer <login>`
- Hide "Preview in browser" menu option when any metadata are set
2020-04-17 20:23:57 +02:00
Mislav Marohnić
f0e6c98bf0 Fix auto-forking scenario in pr create
When an existing `headRepo` couldn't be detected, it's time to auto-fork
one. Unfortunately, an obscure Go behavior made it seem like `headRepo`
was a non-nil value, where in fact it did contain a nil pointer which
would crash the process.

This avoids ever assigning nil pointers to `var headRepo ghrepo.Interface`.
2020-04-01 19:37:56 +02:00
Mislav Marohnić
24a332bb1b Use remote tracking branch for base when detecting commits for pr create
This is to avoid errors when a local base branch is missing or out of
date.
2020-03-31 13:32:44 +02:00
Mislav Marohnić
da2116f8ee Merge remote-tracking branch 'origin/master' into pr-create-push-default 2020-03-30 13:32:37 +02:00
Mislav Marohnić
cba8331d55 Avoid auto-forking/pushing an already pushed branch in pr create
A branch is considered already pushed if its HEAD commit hash matches
the commit hash of one of the remote tracking branches:
`refs/remotes/<remote>/<branch>`

This mechanism allows the user to:

- Choose a remote as push target for their branch different than the one
  that would automatically get chosen for them by `pr create`;

- Avoid a `git push` operation (and its associated git hooks) if a push
  was not necessary in the first place.
2020-03-26 20:35:42 +01:00
Mislav Marohnić
5b2e1847b7 Merge remote-tracking branch 'origin/master' into pr-create-push-default 2020-03-25 08:16:04 +01:00
vilmibm
2895252e3b respect -B when checking for existing pull requests 2020-03-23 14:26:31 -05:00
Mislav Marohnić
e3653672a8 Simplify git.AddRemote implementation
The 2nd argument now unused since we've determined that, in practice, we
can safely fetch git objects from a freshly created fork on GitHub and
that we don't need the remote URL-swapping workaround.
2020-03-20 13:08:33 +01:00
Mislav Marohnić
d75faab85a Creating a PR now always prioritizes an existing fork as a push target
Before: the default push target for the current branch in `pr create`
was the first repository found among git remotes that has write access.

Now: the default push target is the fork the base repo, if said fork
exists and has write access, falling back to old behavior otherwise.

This change in the default is to facilitate contributions to projects
that have a hard requirement that all pull requests (even those opened
by people with write access to that project) come from forks.
2020-03-19 16:04:23 +01:00
Mislav Marohnić
5b76881624 Improve detecting existing PR on pr create
- Only check for existing PRs if `--web` wasn't given
- Fix detecting PRs from forks
- Improve order of error handling: local validation errors are handled
  earlier than the ones that have to consult the API
2020-03-18 13:09:02 +01:00
Mislav Marohnić
23dfeff84f Merge remote-tracking branch 'origin/master' into check-if-pr-exists 2020-03-18 12:04:08 +01:00
vilmibm
0344e9543a humanize branch name for title 2020-03-17 16:18:32 -05:00
vilmibm
98a2281f45 more nuanced error handling 2020-03-17 16:09:40 -05:00
vilmibm
af46fcb1ff --fill for pr create 2020-03-16 15:32:47 -05:00
vilmibm
2d90c09f48 review feedback 2020-03-16 15:32:35 -05:00
Tarasovych
d0c32e7a3d changed error message and pr check 2020-03-16 16:01:03 +02:00
vilmibm
8769299731 titlebody prepopulation 2020-03-13 15:12:03 -05:00
Tarasovych
f3c9406e76 fixed repo argument 2020-03-13 16:01:37 +02:00
Tarasovych
b544583b26 added check if pr already exists 2020-03-13 14:02:29 +02:00
Mislav Marohnić
d584a9692c Raise error if --draft was used in pr create --web
Since we cannot pass the "draft" option as query parameter, this raises
an error instead of proceeding to open the browser and potentially
confuse the user as to why `--draft` wasn't respected.
2020-03-09 14:53:27 +01:00