Commit graph

60 commits

Author SHA1 Message Date
Kynan Ware
3af535902d Add usage examples to gh gist edit command
Add a cobra Example string to the gist edit command showing common
operations: interactive selection, editing in default editor, editing a
specific file, replacing file content, adding/removing files, and
changing the description.

Closes #8943

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-17 12:38:15 -07:00
Lucas
42238dc365
fix(gist): prevent fetching full content for already edited files 2025-10-30 05:55:53 +01:00
Lucas
c98c435800
fix(gist): only include files that have changed in request
There was some issues when sending the full list of files, some of them would be truncated.
2025-10-30 05:49:52 +01:00
Lucas
f8651f5e44
fix(gist): fetch full content for truncated files during editing
This change makes it only fetch the raw content, when we wanna edit the specific file.
2025-10-30 05:48:34 +01:00
Lucas
bf272305ff
feat(gist): retrieve full content for truncated gist files
* Added logic to fetch full content for truncated files when updating a gist.
* Utilizes `shared.GetRawGistFile` to retrieve the complete content based on the `RawURL`.
2025-09-18 06:35:35 +02:00
phanium
19e1178a32
fix: gh gist edit panic when no file in a gist (#10627)
* fix: `gh gist edit` panic when no file in a gist

* fix: improve error message

Signed-off-by: Babak K. Shandiz <babakks@github.com>

---------

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2025-05-28 14:40:14 +01:00
Kynan Ware
facd0caa29 Fix: accidental whitespace in gist edit 2025-01-16 11:44:46 -07:00
Kynan Ware
a2dce589d6 Merge 'trunk' into fix/issue_10042 2025-01-16 11:06:36 -07:00
Mateus Marquezini
24e9fed7e0 removed unnecessary space 2025-01-12 14:57:24 -03:00
Mateus Marquezini
c5d6ae6cf6
Update pkg/cmd/gist/edit/edit.go
Update pkg/cmd/gist/edit/edit.go after code review

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-01-12 14:53:20 -03:00
Mateus Marquezini
f4f8840c3f #10042: Add error messages for 'gh gist view/edit' prompts when no TTY is detected 2025-01-09 12:07:15 -03:00
danochoa
9c65a32ef8 gist delete prompt with gist description 2025-01-08 17:56:02 -06:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
William Martin
491e9e8e58
Ensure gist edit request body matches desired schema (#7635)
* Ensure gist edit request body matches desired schema

* Immediately transform gist to gistToUpdate in edit flow

* Remove maps package and change to NewFilename
2023-07-03 13:33:49 +09:00
Kousik Mitra
baba894997
Add option to remove file from gist (#7560) 2023-06-23 14:08:21 +02:00
Kousik Mitra
31209bcf89
Replace SurveyAskOne with Prompter 2023-06-05 22:48:21 +05:30
Kousik Mitra
9ccd098eb0
Add gist selector option to gist edit command 2023-06-05 22:07:04 +05:30
Sam Coe
c9a2d85793
Cleanup config.AuthToken and config.DefaultHost methods (#7049) 2023-02-28 00:24:45 +00:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
Sam Coe
cacff4ad6d
Use go-gh config package (#5771) 2022-06-23 11:50:04 +00:00
Sam Coe
f7710dedd2
Allow non-interactive gist file replacement (#5408) 2022-04-06 15:49:52 +02:00
nate smith
2f19fa792f maint: clean up some errors 2022-01-24 17:34:21 -06:00
nate smith
de4e37ed75 Merge remote-tracking branch 'origin/trunk' into feat/gist-edit 2022-01-24 17:34:09 -06:00
Nate Smith
f950637b0b
Merge pull request #4738 from SteadBytes/gist-edit-description
Support editing gist description
2022-01-18 09:34:22 -06:00
Tomohiro Nishimura
a9d397be69
Add --generate-notes flag to gh release create command. (#4467) 2021-12-08 15:20:59 +04:00
Ben Steadman
f30e76aab8 Support editing gist description
Add a --desc flag to gh gist edit to support editing gist
descriptions. This flag can be used in combination with the other gist
editing flags to edit the description whilst also adding/editing files.

Signed-off-by: Ben Steadman <steadmanben1@gmail.com>
2021-11-16 20:18:53 +00:00
tdakkota
ab668e8419
gist edit: add way to edit files from different sources
This commit adds an optional parameter to set source for editing or adding files to gist.
If parameter is equal to "-" then stdin will be used.
2021-11-01 10:28:30 +03:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Nate Smith
2fbc037658
Merge pull request #3042 from g14a/bug/gist-binary-files
Remove functionality to add, view and edit binary files in gists
2021-03-04 13:01:54 -06:00
Mislav Marohnić
e16c3124dd Disallow binary files with gist edit -a 2021-03-02 14:58:16 +01:00
Mislav Marohnić
77d9051d0e Simplify looking up binary types in gist 2021-03-02 14:53:10 +01:00
Gowtham Munukutla
973fbb0925 Disallow operating on binary files in gist 2021-03-02 14:52:44 +01:00
Mislav Marohnić
dd34cae112 Merge remote-tracking branch 'origin' into cancel-error-status 2021-03-02 13:52:07 +01:00
Mislav Marohnić
2ebdde1ddd Exit with status code "2" on user cancellation errors
This also stops printing "interrupt" after Ctrl-C is pressed.
2021-03-02 13:48:44 +01:00
Mislav Marohnić
8f96e406ac Improve error handling and avoid writing confirmation to stdout
Right now the `gist edit` command doesn't write anything to stdout, so
let's keep it that way until we want to intentionally provide some
feedback in the terminal.
2021-02-27 12:23:18 +01:00
Mislav Marohnić
406d7eee45 💅 cleanup gist edit -a feature 2021-02-27 12:07:35 +01:00
Gowtham Munukutla
7fd0634a24 rebase with trunk 2021-02-25 14:47:26 +05:30
Gowtham Munukutla
56ead91702 Add helper function to validate exact args in cmdutil 2021-02-24 15:49:40 +05:30
Gowtham Munukutla
d4e14beb57 remove unwanted tests and unwanted functionality 2021-02-24 10:14:31 +05:30
Gowtham Munukutla
a6fa14866b updating tests WIP 2021-02-24 09:44:11 +05:30
Gowtham Munukutla
4ed10140ab Resolved PR review comments and test cases 2021-02-19 12:02:17 +05:30
Gowtham Munukutla
882bd1adb1 add go lint to pass checks 2021-02-18 22:39:56 +05:30
Gowtham Munukutla
9a4fd0d706 Remove unwanted prompt for user. Unwanted test as well 2021-02-18 19:17:42 +05:30
Gowtham Munukutla
bff8b3007a Add test cases and improve errors with color schemes 2021-02-18 18:45:43 +05:30
Gowtham Munukutla
2983887458 Add files by absolute path to gist 2021-02-17 20:39:43 +05:30
Gowtham Munukutla
037343c5c2 Add existing files in the current wd to gist 2021-02-17 19:20:43 +05:30
Gowtham Munukutla
05e45e3863 Feature of adding new files to an existing Github gist 2021-02-17 11:27:57 +05:30
Mislav Marohnić
622317ee89 Tweak gist docs 2021-02-03 22:39:58 +01:00
Cristian Dominguez
55c717d3d3 Print friendly error when 'gh gist <command>' is missing required argument 2020-12-21 10:01:30 -03:00