Commit graph

63 commits

Author SHA1 Message Date
Mislav Marohnić
ac94ae5872 Return interface from determineBaseRepo(), not pointer to interface
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`.
2020-02-24 13:40:58 +01:00
Mislav Marohnić
9c00ac0224 Tweak verbose HTTP logging
- log headers only in DEBUG=api mode
- enable color output on stderr
- hide little-useful TLS debbuging info
- ensure all request headers are logged
2020-02-21 12:57:00 +01:00
Mislav Marohnić
408b565fd9 Allow setting version via ldflags again 2020-02-18 13:47:57 +01:00
Colin Arnott
de6e99aa75
command: default to toolchain version
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.
2020-02-18 07:55:54 +00:00
vilmibm
6732aa9725 fix tests 2020-02-12 08:48:25 -06:00
vilmibm
135c63aa36 remove --self for now 2020-02-11 20:46:46 -06:00
vilmibm
c93c5f7668 move determineBaseRepo to root 2020-02-11 19:44:49 -06:00
HowJMay
c517fd79b9 fix: Fix typos
Fix typos in files
2020-02-02 01:49:11 +08:00
Mislav Marohnić
2a49efc789 Fix gh version printing the correct changelog link
Previously, the version string didn't match the `vX.Y.Z` pattern because
the wrong variable was passed to `changelogURL`.
2020-01-29 16:03:10 +01:00
Mislav Marohnić
7b28605e6f Fix current changelog link in gh version
Also allow pre-release tags.
2020-01-28 18:31:12 +01:00
Mislav Marohnić
1c74227ed7 Use new repo name for update notifier and changelog 2020-01-28 18:22:29 +01:00
Amanda Pinsker
250286d531
Add updated feedback form link 2020-01-27 12:55:57 -08:00
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Nate Smith
3764e25921 Merge pull request #248 from github/main-pkg
Move main package to under `cmd/`
2020-01-23 09:34:54 -06:00
Mislav Marohnić
4f6dfee965 Merge remote-tracking branch 'origin/master' into pr-create-just-works-TM 2020-01-23 14:08:07 +01:00
Mislav Marohnić
537b0a8429 Friendlier output for network connectivity errors
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
2020-01-23 12:48:10 +01:00
Mislav Marohnić
0b0fd42ef3 Dump HTTP request/response bodies when DEBUG=api 2020-01-22 19:35:39 +01:00
Mislav Marohnić
6799e7f570 Avoid resetting the current branch when --repo is used
This leads to unwanted consequences in `pr create`
2020-01-22 19:33:53 +01:00
Nate Smith
a9db4e8d21 Merge pull request #221 from github/release-the-kraken
Add changelog link to `gh version` and `gh --version`
2020-01-13 18:08:50 -06:00
Corey Johnson
ced6809e1e add changelog to --version 2020-01-13 11:14:45 -08:00
Corey Johnson
1921a74eec Add changelog func 2020-01-13 11:02:34 -08:00
Tiernan L
756610301e Swap to show 2020-01-10 07:53:16 -10:00
Tiernan L
b2350be56a change print to view 2020-01-09 09:54:34 -10:00
Mislav Marohnić
f39d57862d Clarify -R format 2019-12-19 18:55:31 +01:00
Amanda Pinsker
de814595f5 Clarify repo flag language 2019-12-17 11:22:41 -05:00
Mislav Marohnić
030c997301 Avoid long first line of gh help
This splits help text over paragraphs and lines to make the output of
`gh` easier to read. It takes care not to go over 80 characters in width
and wraps the URL in `<...>` which will help the URL get auto-linked
when these docs are converted to man and HTML formats.
2019-12-16 15:55:21 +01:00
Corey Johnson
387b9d9544 better name? 2019-12-06 13:33:23 -08:00
Corey Johnson
f1eb29b791 Add colorableErr 2019-12-06 13:32:36 -08:00
Corey Johnson
418da8713b Merge pull request #128 from github/add-feedback
Add google form link to root help description
2019-12-04 10:48:33 -08:00
Mislav Marohnić
87a1490d1e Improvements to update notifier authentication
- Check for updates even if `~/.config/gh` does not exist. In this case,
  the API call is unauthenticated.

- Avoid having the update notifier ever triggering the OAuth flow.
2019-12-04 15:41:08 +01:00
Amanda Pinsker
8369372501 Add google form link to root help description 2019-12-03 08:58:05 -05:00
Corey Johnson
1231ddd01c Add test 2019-12-02 15:08:36 -08:00
Mislav Marohnić
64dcdd68e5 Merge pull request #118 from github/win-ansi-color
Fix ANSI color output on Windows
2019-11-28 11:47:02 +01:00
Mislav Marohnić
ae2e8f057c Merge branch 'master' into flags-language 2019-11-27 23:18:20 +01:00
Mislav Marohnić
b6fa88337d Ensure that commands print to a colorable output
If a command does `fmt.Print(...)` for output that contains ANSI color
codes, this not safe on Windows. We have to ensure that we always use
the `fmt.Fprint*` family of functions with a writer that was transformed
using `utils.NewColorable()`.
2019-11-27 20:51:51 +01:00
Mislav Marohnić
854a4b3fdf 💅 Sentence-case for --help and --version flags 2019-11-27 17:26:27 +01:00
Mislav Marohnić
b8a0754a03 💅 Sentence case for CLI flags 2019-11-27 17:09:40 +01:00
Mislav Marohnić
002aac3519 Remove global -B, --current-branch flag
Now `pr list --base` has shorthand `-B`
2019-11-27 17:05:49 +01:00
Mislav Marohnić
b8251650db Have gh version be an alias for gh --version 2019-11-27 16:42:38 +01:00
Mislav Marohnić
4ec31ffd57 Strip the "v" prefix when displaying gh version string 2019-11-27 16:42:13 +01:00
Amanda Pinsker
977d47b263 Shorten top summary 2019-11-22 11:07:59 -08:00
evelyn masso
b30054c55a use the offish tag line from @ampinsk 2019-11-21 10:20:54 -08:00
evelyn masso
b64db1213f formatting 😅 2019-11-20 15:11:25 -08:00
evelyn masso
11d569f340 expand root help summary 2019-11-20 15:10:14 -08:00
Amanda Pinsker
5e7557e8fa Copy edits 2019-11-18 23:26:18 -08:00
Mislav Marohnić
04f20ddb2b Use statusCheckRollup internal GraphQL to simplify Statuses+Checks
With the old approach, we had to enumerate all StatusContexts and
CheckRuns to calculate whether a PR has passing or failing CI status.

Using `statusCheckRollup` which is behind the `pe_mobile` feature flag,
this is somewhat simpler because both StatusContexts and CheckRuns are
now behind the same connection.

Additionally, should we decide to *not* show the number of
passing/failing checks, this now approach allows us to consume the
`statusCheckRollup { state }` field and avoid paginated collections
and calculating the "winning" state altogether.
2019-11-15 11:43:00 +01:00
Mislav Marohnić
933086bae9 Merge remote-tracking branch 'origin/master' into pr-create 2019-11-13 19:31:02 +01:00
Mislav Marohnić
a275398dac Merge remote-tracking branch 'origin/master' into pr-create 2019-11-11 12:24:09 +01:00
Mislav Marohnić
7419f7ae64 Add checks, reviews info to pr status 2019-11-08 21:04:47 +01:00
Mislav Marohnić
2939924124 Merge branch 'master' into version-flag 2019-10-31 23:13:07 +01:00