Commit graph

609 commits

Author SHA1 Message Date
Mislav Marohnić
3aaa231cc5 Guide user through re-authorization flow if read:org scope is missing
How this works for people with existing OAuth tokens:

    $ gh issue list -L1
    Notice: additional authorization required
    Press Enter to open github.com in your browser...
    [auth flow in the browser...]
    Authentication complete. Press Enter to continue...

    Showing 1 of 132 issues in cli/cli
    ...

Users of Personal Access Tokens get a different notice:

    Warning: gh now requires the `read:org` OAuth scope.
    Visit https://github.com/settings/tokens and edit your token to enable `read:org`
    or generate a new token and paste it via `gh config set -h github.com oauth_token MYTOKEN`
2020-04-23 18:20:21 +02:00
Mislav Marohnić
8ed9a0324e Merge remote-tracking branch 'origin/master' into oauth-read-org 2020-04-23 15:35:35 +02:00
vilmibm
97e3a57244 fix tests 2020-04-22 16:16:14 -05:00
vilmibm
03e60758d0 missed a thing 2020-04-22 16:08:47 -05:00
Nate Smith
9d7590cbfc
Merge pull request #810 from cli/respect-protocol
respect git_protocol setting
2020-04-22 15:54:38 -05:00
vilmibm
f1bee0c9b9 use more clear name 2020-04-22 15:49:16 -05:00
vilmibm
f26690adc9 support GH_EDITOR 2020-04-22 14:33:56 -05:00
vilmibm
9641eee38a use more clear name 2020-04-22 14:31:09 -05: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
vilmibm
3c8b87c9c6 respect configured editor 2020-04-22 11:23:14 -05:00
vilmibm
d4dd4a68bf fix error handling 2020-04-21 11:25:23 -05:00
vilmibm
fcf258620c ignore MarkHidden errors 2020-04-21 11:23:38 -05:00
vilmibm
6e55e899fa handle defaults at the Config level instead of ConfigMap 2020-04-21 10:59:44 -05:00
vilmibm
bba63439dc slopwip for defaults 2020-04-21 10:32:57 -05:00
vilmibm
3220f2ef53 linter appeasement 2020-04-20 14:00:06 -05:00
vilmibm
c4693077aa move config stuff to its own package 2020-04-20 13:57:16 -05:00
vilmibm
815f461e8b more strict erroring around missing user/token 2020-04-20 12:49:46 -05:00
vilmibm
1a5bc0687e usage cleanup 2020-04-20 12:33:32 -05:00
vilmibm
bd907ec74d favor %w over %s for error wrapping 2020-04-20 12:22:12 -05:00
vilmibm
a325db3051 new config infrastructure
- adds config get and config set commands
- supports arbitrary k/v strings set at top and host level
- supports writing an updated config, preserving comments
- supports mostly lazy evaluation of yaml
2020-04-17 15:17:44 -05:00
Mislav Marohnić
3d566dc5a6 Detect and warn about read:org OAuth scope being missing 2020-04-15 17:25:15 +02:00
Mislav Marohnić
f09994dd84 Appease linter that warns about redundant type in composite literals 2020-04-13 15:15:41 +02:00
Nate Smith
c670049ce7
Merge pull request #745 from doi-t/add-metadata-to-view
Add relevant metadata to issue view in CLI
2020-04-09 16:27:07 -05:00
Mislav Marohnić
d14b5d3e2c
Merge pull request #764 from cli/pr-view-docs
Improve `issue/pr/repo view` documentation
2020-04-09 19:12:34 +02:00
Nate Smith
3c335104c5
Merge pull request #748 from doi-t/add-pr-metadata-to-view
Add relevant metadata to pr view in CLI
2020-04-09 12:12:18 -05:00
Mislav Marohnić
7f9aef6c0d
Merge pull request #761 from cli/completion-fixes
Improve `completion` command
2020-04-09 19:10:36 +02:00
Toshiya Doi
6d0e5bf2b8 Remove Participants related codes for pr view` 2020-04-10 01:02:51 +09:00
Toshiya Doi
054ec3c635 Remove Participants related codes 2020-04-10 00:56:45 +09:00
Toshiya Doi
531bfbc295 Update unit tests for PR metadata 2020-04-08 20:07:19 +09:00
Mislav Marohnić
d1754b2bb0 Improve issue/pr/repo view documentation
- Short-form docs for `pr/repo view` no longer say "in browser"

- Long-form docs for all these commands now list more information about
  what will be displayed in the terminal, plus stressing out the
  alternate behavior with the `--web` flag.

- `--web` flag docs: add English articles
2020-04-08 12:04:39 +02:00
Toshiya Doi
542314a9c3 Omit participants metadata from pr view 2020-04-08 14:53:23 +09:00
Toshiya Doi
9169c8d0eb Update unit tests for issue metadata 2020-04-08 14:48:08 +09:00
Toshiya Doi
d600709e9e Omit participants metadata from issue view 2020-04-08 13:50:13 +09:00
Mislav Marohnić
2915abc2ba Improve user-friendliness of completion command
When ran directly in the terminal, the command now errors out with:

    $ gh completion
    error: the value for `--shell` is required
    see `gh completion --help` for more information

This is to avoid the previously default bash code output confusing the
user if they ran the command out of curiousity.

A backwards compatibility layer is present here: if stdout is not a
terminal, then output bash code like before. This is to support users
who have already added a line like this to their bash profile:

    eval "$(gh completion)"
2020-04-07 16:58:50 +02:00
Tiernan L
1aba837589
update text to long-form
Change from "repo" to "repository".  Run "gh repo clone -h` to see the usage text I am referring to.

We use the word "repository" here:

Usage:
  gh repo fork [<repository>] [flags]

Usage:
  gh repo view [<repository>] [flags]
2020-04-06 11:27:17 -10:00
Tiernan L
806574f9c1
spell out PR
changes "PR" ---> "pull request" for consistency and clarity
2020-04-06 09:56:45 -10:00
Mislav Marohnić
e878cdf060
Merge pull request #752 from lumaxis/feature/fetch-upstream-after-adding
Fetch upstream remote after adding it

Fixes #731
2020-04-06 19:48:14 +02:00
Lukas Spieß
7e1ed5f9a3
Fetch upstream remote after adding it 2020-04-05 20:54:29 +02:00
Toshiya Doi
f14459c451 Clean up unnecessary fmt.Sprintf 2020-04-04 15:11:57 +09:00
Toshiya Doi
d5bff70259 Clean up unnecessary fmt.Sprintf 2020-04-04 15:09:22 +09:00
Toshiya Doi
85d8f808f2 Test pr metadata in CLI preview 2020-04-04 13:14:34 +09:00
Toshiya Doi
0cb6890c74 Print pr metadata in CLI preview 2020-04-04 13:09:34 +09:00
Toshiya Doi
5a17962188 Add a new line to test a dynamic string of metadata 2020-04-04 12:53:22 +09:00
Toshiya Doi
13864131c0 Rename issue metadata list functions to avoid naming conflicts with pr 2020-04-04 11:28:52 +09:00
Toshiya Doi
1279131f0f Simplify issue struct avoiding to sue edges 2020-04-04 11:28:52 +09:00
Toshiya Doi
97cad74d75 Add a new line even an issue Body content is empty 2020-04-04 11:28:52 +09:00
Toshiya Doi
8c697a0d99 Test issue metadata in CLI preview 2020-04-04 11:28:52 +09:00
Toshiya Doi
bfb3501cf9 Print issue metadata in CLI preview 2020-04-04 11:28:52 +09:00
Mislav Marohnić
e10ccefaf5
Merge pull request #667 from doi-t/view-the-current-state
Show the state (open, closed, merged) in issue view and pr view
2020-04-03 19:41:29 +02:00
Mislav Marohnić
43b28f769b
Merge pull request #727 from thefotios/respect-clone-target
Respect clone target

Closes #721
2020-04-03 19:18:05 +02:00