Commit graph

131 commits

Author SHA1 Message Date
Kynan Ware
07744e8e80 Fix gofmt formatting in godoc comments
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 16:16:13 -07:00
Kynan Ware
b8ee5c5eba Add godoc comments to exported symbols in remaining packages
Add documentation comments to exported symbols across all remaining
smaller packages including cmd/gen-docs, context, internal/browser,
internal/gh, internal/ghcmd, internal/ghinstance, internal/ghrepo,
internal/keyring, internal/run, internal/safepaths, internal/tableprinter,
internal/text, internal/update, pkg/cmd/accessibility, pkg/cmd/actions,
pkg/cmd/alias, pkg/cmd/api, pkg/cmd/browse, pkg/cmd/cache,
pkg/cmd/completion, pkg/cmd/copilot, pkg/cmd/factory, pkg/cmd/gpg-key,
pkg/cmd/label, pkg/cmd/licenses, pkg/cmd/org, pkg/cmd/preview,
pkg/cmd/ssh-key, pkg/cmd/version, pkg/extensions, pkg/jsoncolor,
pkg/markdown, pkg/option, pkg/set, pkg/ssh, pkg/surveyext, test,
internal/authflow, and utils.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 16:14:20 -07:00
Andy Feller
81eeaca959 Align no default repo message with other uses 2025-02-10 17:24:43 -05:00
Azeem Sajid
e1d1f21525 [gh repo view] Improve error message for forked repo 2025-01-30 12:38:50 +05:00
Babak K. Shandiz
642b2c57c1
Add tests for FindByRepo
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-04 00:19:15 +01:00
Babak K. Shandiz
72fcd8c87d
Improve error message returned by FindByRepo
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-02 21:46:28 +01:00
EBIBO
fd8bbf0be5
gh pr create duplicates targets if there are duplicate remotes (#8184)
* `gh pr create` duplicates targets if there are duplicate remotes

* De-duplicate the same remote
2023-10-17 08:21:35 +00:00
Des Preston
94fe6c7764
Fix set-default interactive not showing all remotes (#6969) 2023-02-07 23:11:38 +00:00
vilmibm
22a9cb8856 tweak selection 2023-01-03 13:57:54 -08:00
vilmibm
290d90430d select base repo correctly when only one remote 2023-01-03 11:58:48 -08:00
vilmibm
f5d19b831e error instead of prompt when no base repo + fixes 2022-12-15 11:44:37 -08:00
vilmibm
7e3e2d96a8 Merge remote-tracking branch 'origin/trunk' into base-cmd 2022-12-13 10:39:40 -08:00
Sam Coe
4294ee14a1
revert revert 57fbe4f317 (#6474) 2022-10-20 12:17:20 +00:00
Sam Coe
2cefb9fa59
Fix pr create regression (#6472)
* Revert "Refactor to use new git client (#6447)"

This reverts commit 57fbe4f317.

* Fix pr create regression
2022-10-20 12:46:23 +03:00
Sam Coe
57fbe4f317
Refactor to use new git client (#6447) 2022-10-19 21:11:36 +03:00
vilmibm
7b21a3ea45 use Prompter in context 2022-09-21 11:33:28 -07:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
Sam Coe
743a747804
Use go-gh for SSH hostname alias translation (#5654) 2022-06-08 21:32:29 +00:00
Sam Coe
63a3adf212
Use strings.Cut 2022-05-18 08:42:14 +02:00
Sam Coe
c89d8cb759
Backport strings.Cut 2022-05-18 08:40:30 +02:00
Sam Coe
22a5d2abf8
Refactor code to live inside default pkg 2022-05-18 08:40:30 +02:00
bchadwic
66a69bdec5
fixing lint and formatting 2022-05-18 08:40:29 +02:00
bchadwic
08b02da3fc
beginning testing 2022-05-18 08:40:29 +02:00
bchadwic
ca5e9a49b5
thinking of a better solution, wip. BaseRepo() might be better split up 2022-05-18 08:40:29 +02:00
nasa
88f490bcd9
issue view: ensure loading indicator is stopped when a prompt is shown (#5641)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-05-17 13:05:56 +00:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
02a2ed2f73 Add repo view --json export functionality 2021-05-12 17:05:15 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
Cristian Dominguez
45f4a1f087 Equal: flip arguments position 2021-01-18 21:00:59 -03:00
Cristian Dominguez
3afb1d0b1a Use Testify assertions in test 2021-01-16 19:19:30 -03:00
Josh Soref
c8b9486fd3 spelling: nonexistent 2020-11-21 21:43:51 -05:00
Mislav Marohnić
7a8db80420 Prompt for push target during pr create
We no longer guess the head repository using heuristics; instead, we
present the user with the choice of pushable repositories and an
additional option to create a new fork.

The new `pr create --head` flag is available for the user to specify the
head branch in `branch` or `owner:branch` format and completely skip any
forking or auto-pushing checks.
2020-09-16 14:49:36 +02:00
Mislav Marohnić
d534a94d1b Change how base repository is resolved
On first run in a git repository, `BaseRepo()` will now prompt the user
which repository should be queried as base repository if there are
multiple git remotes or when we are in the context of a fork.

In non-interactive mode, the prompt is skipped and we default to the
first git remote instead.

After the base repo is resolved, the result is cached in the local
repository using `git config` so that RepositoryNetwork API lookups can
be avoided in the future.
2020-09-15 21:27:12 +02:00
Mislav Marohnić
969321bff2 🔥 cleanup in context 2020-09-15 19:09:16 +02:00
Mislav Marohnić
b7550fbf15 Correctly surface errors when parsing pr create --repo override
This avoids a crash when passing invalid input for the
`pr create --repo` flag.
2020-08-27 14:26:27 +02:00
Mislav Marohnić
c095a4bead Allow explicitly specifying the hostname for gh operations
Accept the "HOST/OWNER/REPO" syntax or passing a full URL for both the
`--repo` flag and the GH_REPO environment variable and allow setting
GH_HOST environment variable to override just the hostname for
operations that assume "github.com" by default.

Examples:

    $ gh repo clone example.org/owner/repo
    $ GH_HOST=example.org gh repo clone repo

    $ GH_HOST=example.org gh api user
    $ GH_HOST=example.org gh gist create myfile.txt

    $ gh issue list -R example.org/owner/repo
    $ gh issue list -R https://example.org/owner/repo.git
    $ GH_REPO=example.org/owner/repo gh issue list
2020-08-12 16:16:34 +02:00
Mislav Marohnić
dbbf76df10 Cleanup in context 2020-08-07 14:51:48 +02:00
Mislav Marohnić
47cef736f4 Fix GH_REPO override 2020-08-07 14:47:58 +02:00
Mislav Marohnić
aef1a4ba4d Extract root command and factory logic into separate packages 2020-08-07 14:40:33 +02:00
Mislav Marohnić
288d01318b Respect the hostname of current repository in queries 2020-07-23 22:31:08 +02:00
Mislav Marohnić
f93261a6f9 Revert to ignoring non-github.com git remotes
This fixes a regression where extra git remotes pointing to
non-github.com hostnames could result in gh trying to parse repository
information from them.
2020-07-16 18:54:35 +02:00
Mislav Marohnić
a68cefadd9 Merge remote-tracking branch 'origin' into ghe-remotes 2020-07-02 20:37:33 +02:00
Mislav Marohnić
446a4111f7 Respect hostnames when resolving git remotes and URL args to repos 2020-07-02 20:36:10 +02:00
Mislav Marohnić
ab903bdfc0
Merge pull request #1155 from metalogical/FIX-detached-head
fix regression in support for detached HEAD state
2020-06-24 17:01:22 +02:00
Mislav Marohnić
3ea71e6eb6 Add ability to parse non-GitHub.com git remotes 2020-06-23 19:51:26 +02:00
naman
fffa393683 fix lint 2020-06-11 17:08:18 -07:00
naman
fb7b01b40c resolve PR review 2020-06-11 17:05:25 -07:00
gedenata
8ffd0d59f6 redundant type composite literal 2020-06-12 04:23:51 +08:00
naman
3bb6983b35 fix regression in support for detached HEAD state
for gh pr status
2020-06-10 11:41:44 -07:00