Commit graph

1821 commits

Author SHA1 Message Date
Jason Lunz
06eb5ad47f
fetch remote ssh usernames in parallel 2021-12-17 16:10:44 -07:00
Jason Lunz
2ee88da647
close session on error 2021-12-17 14:42:54 -07:00
Jason Lunz
a05541f4ed
drop redundant API call 2021-12-17 11:39:14 -07:00
Jason Lunz
0670a7758b
use generic io interfaces 2021-12-17 11:18:59 -07:00
Jason Lunz
811d6505d2
tighten up ssh config help wording 2021-12-17 11:03:11 -07:00
Jason Lunz
206b6379c3
return non-zero if ssh config skips any codespaces 2021-12-17 10:47:22 -07:00
Jason Lunz
a9d02a746b
push fetching codespace details into openSSHSession callers 2021-12-16 17:19:34 -07:00
Jason Lunz
ac685611b1
openssh -> OpenSSH 2021-12-16 17:00:40 -07:00
Jason Lunz
71c9fa11f0
add more ssh config --help documentation 2021-12-16 17:00:40 -07:00
Jason Lunz
369ea534b6
explain why failure to connect to a codespace doesn't fail the entire command 2021-12-16 17:00:39 -07:00
Jason Lunz
4a6887f99e
add a comment explaining why we build an sshUsers map 2021-12-16 17:00:38 -07:00
Jason Lunz
6f8635a17e
listOpensshConfig -> printOpenSSHConfig 2021-12-16 17:00:37 -07:00
Jason Lunz
b7cd2bbc72
no need to separately declare vars here 2021-12-16 17:00:37 -07:00
Jason Lunz
3cb3cf7ca5
make ListOpensshConfig private 2021-12-16 17:00:36 -07:00
Jason Lunz
96a2e125e6
document the codespaceSSHConfig struct 2021-12-16 17:00:36 -07:00
Jason Lunz
ca3b59dd35
use struct embedding to express this less verbosely 2021-12-16 16:09:33 -07:00
Jason Lunz
ac3b0c50e3
Ssh -> SSH 2021-12-16 16:09:32 -07:00
Jason Lunz
92609bd1ec
Revert "use go-multierror to combine read/write close errors"
This reverts commit 456f4381e02aa843ddb3cc1b9628cb81487ba895.
2021-12-16 16:09:32 -07:00
Jason Lunz
3ca5cbab84
hide the gh cs ssh --stdio option in the --help message 2021-12-16 16:09:31 -07:00
Jason Lunz
8687fcb2a0
clean up gh cs ssh option parsing/validation 2021-12-16 16:09:30 -07:00
Jason Lunz
c9d0085e57
move gh cs ssh --config into a separate gh cs ssh config command
We could also move this to a toplevel command, but I don't want to
pollute that namespace too much. Open to suggestions.
2021-12-16 16:09:30 -07:00
Jason Lunz
0e6abda73b
allow generating ssh config for a single codespace 2021-12-16 15:42:39 -07:00
Jason Lunz
92403f3a2f
check for incompatible command line options 2021-12-16 15:42:38 -07:00
Jason Lunz
7765000601
add gh cs ssh openssh config file generator 2021-12-16 15:42:38 -07:00
Jason Lunz
4306762f8b
factor out openSshSession() helper function 2021-12-16 15:42:37 -07:00
Jason Lunz
c5e553e400
implement gh cs ssh --stdio 2021-12-16 15:42:37 -07:00
Jason Lunz
81b658ea75
use go-multierror to combine read/write close errors 2021-12-16 15:42:33 -07:00
Jason Lunz
9416056da1
allow combining os.Stdin and os.Stdout as an io.ReadWriteCloser 2021-12-16 15:41:54 -07:00
Mislav Marohnić
5cd977e328 💅 normalize prompt style for text inputs 2021-12-14 18:38:46 +01:00
Mislav Marohnić
c90fc18b0c Avoid creating repo when cancelling from interactive mode 2021-12-14 18:18:08 +01:00
Mislav Marohnić
3e40780074 💅 repo create cleanups 2021-12-14 18:05:42 +01:00
Mislav Marohnić
21e6d95982 Fix repo create printing created URL in no-TTY mode 2021-12-14 17:49:43 +01:00
Benjamin Chadwick
4bbbf46321
Fix browse last commit when using the repo override flag (#4845) 2021-12-13 15:00:22 +01:00
Mislav Marohnić
2d0b9460be
Merge pull request #4318 from g14a/gh-repo-edit
gh repo edit
2021-12-10 13:44:39 +01:00
Mislav Marohnić
db50b54513 Simplify GraphQL mutations whose response we are not interested in 2021-12-08 13:35:19 +01:00
Des Preston
886f5e0e78 Avoid race condition when updating labels
Update labels using the `addLabelsToLabelable` and
`removeLabelsFromLabelable` mutations instead of via the `updateIssue`
mutation that replaces the entire set of labels. This prevents the edit
operation from clobbering any unseen changes to the list of labels.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-08 13:29:47 +01:00
Sergio Guzmán Mayorga
43ae0e5f87
Add interactive tag selector to create release (#4525) 2021-12-08 16:20:15 +04:00
Tomohiro Nishimura
a9d397be69
Add --generate-notes flag to gh release create command. (#4467) 2021-12-08 15:20:59 +04:00
Mislav Marohnić
29816b63c3
Merge pull request #4862 from cli/api-err-409
api: handle HTTP 409 error message from the server
2021-12-07 19:37:19 +01:00
Mislav Marohnić
7d199fa783 repo edit: add ability to add or remove repository topics 2021-12-07 19:28:29 +01:00
Gowtham Munukutla
98217fc38c gh repo edit
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-07 19:28:29 +01:00
Mislav Marohnić
ead6bf87d9 api: handle HTTP 409 error message from the server
Previously, "errors" field was either an array of strings or an array of
error objects. This covers an additional case when "errors" is a string:

    $ gh api orgs/cli/actions/permissions/repositories
    {
      "message": "Conflict",
      "errors": "Actions are enabled for all repositories",
      "documentation_url": "https://docs.github.com/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization"
    }
2021-12-06 19:54:54 +01:00
rsteube
24c41b5e88 gist view: fix missing files shorthand
converted to `BoolVar`
2021-12-03 10:45:33 +01:00
Alan Donovan
5fea604f78
gh cs cp --help: fix typo 2021-12-02 17:09:20 -05:00
Des Preston
94a640bd2a
Add auth setup-git for setting up gh as a git credential helper (#4246)
Adds a new command `gh auth setup-git [<hostname>]` that sets up git to
use the GitHub CLI as a credential helper.

The gist is that it runs these two git commands for each hostname the
user is authenticated with.

```
git config --global --replace-all 'credential.https://github.com.helper' ''
git config --global --add 'credential.https://github.com.helper' '!gh auth git-credential'
```

If a hostname flag is given, it'll setup GH CLI as a credential helper
for only that hostname.

If the user is not authenticated with any git hostnames, or the user is
not authenticated with the hostname given as a flag, it'll print an
error.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-02 16:38:34 +00:00
Nate Smith
a056fbf0cb
Merge pull request #4838 from cli/go-1.17-fmt
Generate Go 1.17-style `go:build` directives
2021-12-02 10:24:56 -06:00
Sergio Guzmán Mayorga
f13f0e7d87
Add secret set --no-store to print the encrypted secret (#4423)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-02 16:05:10 +00:00
Mislav Marohnić
d02f184bd1 go fmt 2021-12-02 16:12:24 +01:00
Nate Smith
7e7735d450
Merge pull request #4729 from cli/config-list
Add `gh config list`
2021-12-01 17:34:59 -06:00
Nate Smith
6906dea671
Merge pull request #4833 from cli/diff-color
pr diff color output fixes
2021-12-01 10:48:31 -06:00