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`
Per code documentation: "BasicClient returns an API client that borrows
from but does not depend on user configuration". This means that any
errors while reading `oauth_token` should be tolerated.
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.
- 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
This compensates for what appears to be a bug in Cobra, which only
handles `pflag.ErrHelp` unless the error is wrapped. It also might be
that Cobra doesn't recognize Go 1.13-style error wrapping.
It's sufficient to return a value of type `ghrepo.Interface` instead of
a pointer to an interface. This avoids having to use `*` whenever we are
passing the result of `determineBaseRepo()` into another function that
accepts a `ghrepo.Interface`.
Since the Go toolchain is able to extract the module version at build
time, we should use that as a default instead of DEV. This means
customers installing via go-get will get the correct version.
Unfortunately, the toolchain does not store when the build occurs, so
BuildTime now defaults to the empty string. It is still set if build
officially, just not for go-get.
For `net.DNSError`, the full error message can be scary. Instead, print "error
connecting to HOST" and hint that the user should check their internet connection
or githubstatus.com.
When $DEBUG is set, the full DNS error is printed like before.
Fixes#206