Commit graph

80 commits

Author SHA1 Message Date
Babak K. Shandiz
0ec5f13283
fix(pr checkout): add alias co
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-09-24 14:56:59 +01:00
William Martin
64370ce73e Cleanup run command stubbed finders in tests 2025-05-02 14:48:52 +02:00
William Martin
11b9496e17 Fix checkout when URL arg is from fork and cwd is upstream 2025-02-27 16:56:11 +01:00
William Martin
437c52f807 Test pr checkout force on different branch 2025-02-21 13:00:48 +01:00
latzskim
e331daabce [gh pr checkout] Add --no-tags option to git fetch commands in checkout logic 2025-02-20 19:04:16 +01:00
nilvng
42c9d244f7 remove duplicated Prompter type 2025-02-01 11:45:37 +11:00
nilvng
3987f4af4a chore: remove unused file 2024-12-15 18:08:45 +11:00
nilvng
91b3b99b76 issue #2329: create shared PRLister 2024-12-15 17:53:00 +11:00
nilvng
d7cabf18f7 fix: tab format may break checkout prompts 2024-12-15 13:55:47 +11:00
nilvng
1f525bf175 issue #2329: handle empty list of PR 2024-12-15 12:34:46 +11:00
nilvng
5109336963 issue #2329: include PR status in the prompt's options 2024-12-09 21:22:00 +11:00
nilvng
4bc90101cd issue #2329: fix prompt header getting duplicated
following the approach in gh run view seems to fix this issue
2024-12-09 21:20:07 +11:00
nilvng
409e3ca08c issue #2329: simplify the UI of the prompt
This commit reverts the previous color changes in the prompt UI. While color highlighting could potentially improve the visual appealing of the prompt
using the existing color library (mguz/ansi) with the prompt library (AlecAivazis/survey) caused unintended side effects.
It reset the bold text style for the selected option. We decide to that
bold text style would have a higher priority than the color text ,for
three reasons:
1. To maintain consistency with other prompts in the UI and prioritize accessibility
2. While color can enhance the user experience, according to Primer Design Guidelines, color should not be relied upon to convey essential information.
3. visual indicator of the selected option, especially crucial when dealing with long PR titles or branch names.

As a future improvement, we may consider a separate issue or PR to address the color library issue and explore controlled color usage in prompts. This could potentially allow for more nuanced visual differentiation while avoiding unintended style resets.

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2024-12-06 19:59:46 +11:00
nilvng
eced54c904 issue #2329: update the prompt's format
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2024-12-06 18:49:43 +11:00
nilvng
12479e3072 issue #2329: fix unit tests 2024-12-06 18:19:07 +11:00
Kynan Ware
490bfdac03 issue cli#2329: Fix linter 2024-12-04 14:41:30 -07:00
Kynan Ware
1d19878bc4
Merge branch 'trunk' into nil/fix-2329 2024-12-04 14:37:57 -07:00
nilvng
2a1f27ee01 issue cli#2329: fix unsufficent properties required for PR checkout
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2024-12-05 01:07:31 +11:00
nilvng
9c82156e86 issue #2329: move Interactive check to RunE
Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2024-12-03 22:28:02 +11:00
nilvng
985118e36a fix: update the copy 2024-12-03 20:13:38 +11:00
William Martin
694e565384 Fix PR checkout panic when base repo is not in remotes 2024-12-02 17:20:57 +01:00
nilvng
d92e529629 issue #2329: return error when not running interactively 2024-12-01 22:37:53 +11:00
nilvng
e4dced01f7 issue #2329: fix missing stub 2024-11-30 23:51:00 +11:00
Kynan Ware
9c550992ea
Merge branch 'trunk' into nil/fix-2329 2024-11-28 10:10:45 -07:00
William Martin
bd44d33eaa Add checkout test that uses ssh git remote url 2024-11-27 13:06:35 +01:00
William Martin
72a6fd00a4 Rename backwards compatible credentials pattern 2024-11-27 12:21:55 +01:00
William Martin
efd8ff6d46 General cleanup and docs 2024-11-26 22:30:11 +01:00
William Martin
6b7f1ff060 Allow client fetch to use insecure credentials pattern 2024-11-26 22:30:03 +01:00
William Martin
46922694dc Support secure credential pattern 2024-11-26 22:29:38 +01:00
nilvng
36eaf14857 issue #2329: improve UI/UX
Improve the interactive PR selection UI by
- prefix the PR number with hashcode #
- perserve the text formatting (bold) upon an option is hovered
- add the PR head label

Technical changes:
- Replace \033[0m with \033[39m for maintaining text formatting
2024-11-17 23:47:36 +11:00
nilvng
c6c27113fe issue #2329: add happy path unit test 2024-11-17 16:36:10 +11:00
nilvng
1832c1a767 issue #2329: fix the linting issue 2024-11-17 14:58:38 +11:00
nilvng
4386fcb4e5 issue #2329: fix the unit tests issue - ensure its backward compatible 2024-11-17 14:57:48 +11:00
nilvng
7d7c240f4b feat: let user select pr to checkout 2024-11-03 11:38:58 +11:00
William Martin
07e0ff7127 Fix repo fork to use remote protocol if none configured 2024-05-10 10:48:36 +02:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
Zack Sloane
f70bcba779 switch to [] characters for default info in usage strings 2024-02-01 21:35:31 +00:00
Zack Sloane
b6dadfa7fb test update, more consistent default value display 2024-01-08 23:23:24 -05:00
Sam Coe
7924878315
Fix git protocol and refactor Config interface (#8246) 2023-10-27 15:42:05 +02:00
William Martin
6dc04bb1e2 Remove GetOrDefault uses in favour of GitProtocol 2023-10-19 12:57:19 +02:00
Sam Coe
98ab1f2587
Authenticate network git commands (#6541) 2022-11-15 13:14:37 +02:00
Sam Coe
f96b2fce57
Refactor git client and add tests (#6525) 2022-11-03 11:58:38 +01: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
Sam Coe
2944f7c3ab
Create git client (#6354) 2022-10-14 07:47:03 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
nate smith
562f1b3d0d add GetOrDefault functionality to config 2022-01-11 14:56:58 -06:00
Rasmus Wriedt Larsen
9e3893e104 Also set pushRemote on gh pr checkout from fork
As explained in https://git-scm.com/docs/git-config#Documentation/git-config.txt-branchltnamegtremote
if you have `remote.pushDefault` set in your global gitconfig (like I
do), then _that_ setting will take precedence over
`branch.<name>.remote` 😞

However, `branch.<name>.pushRemote` will take precedence over your
`remote.pushDefault` setting, such that
`gh pr checkout 123 && make changes && git push` will just work, even if
you have `remote.pushDefault` set 💪
2021-09-24 16:38:25 +00:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00