{{ message }}
Repository navigation
docs(skills): clarify that skill update replaces directory contents and discards local files - #14689
Open
rajpreetcodes wants to merge 1 commit into
Open
rajpreetcodes wants to merge 1 commit into
rajpreetcodes wants to merge 1 commit into
Conversation
…nd discards local files gh skill update --help previously claimed that --force 'does not remove extra files added locally'. In reality, swapDirectoryContents replaces the installed directory wholesale with the staged upstream contents during any update, discarding locally added files as well as local modifications. Update cmd.Long and example documentation to accurately explain that updates replace the installed directory's contents, and clarify that --force specifically triggers re-downloading and replacement even when the remote tree SHA has not changed. Add assertions in TestNewCmdUpdate_Help. Fixes cli#14647
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #14647
Description
gh skill update --helppreviously stated that--force"does not remove extra files added locally."However,
swapDirectoryContentsreplaces the installed directory wholesale with the staged upstream skill contents for both--forceand standard version updates, so any extra locally-added files in the skill directory are discarded whenever an update is applied (as asserted by the update tests inpkg/cmd/skills/update/update_test.go:L778-L780).This updates
cmd.Longand the--force --allexample description to accurately state that applying an update replaces the installed directory's contents with the upstream skill, discarding local modifications and additional files. It also clarifies that--forcespecifically re-downloads and replaces skills when the remote version matches the local tree SHA.How did you test this change?
I ran
go test -v -run TestNewCmdUpdate_Help ./pkg/cmd/skills/updatewith the updated assertions and verified it passed cleanly.I then ran
go run ./cmd/gh skill update --helpwith the built binary and confirmed the rendered help text:and the updated example line:
Key points
--forcedescription to what the flag actually controls (updating even when the remote tree SHA has not changed).Notes for reviewers
The change is in
pkg/cmd/skills/update/update.gowith corresponding assertions added inTestNewCmdUpdate_Helpinpkg/cmd/skills/update/update_test.go.Authorship and follow-up
Who wrote this:
Who answers review comments: