-
-
Notifications
You must be signed in to change notification settings - Fork 190
feat: support partial clone on Git repository #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support partial clone on Git repository #412
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for partial cloning of Git repositories by introducing a new "--partial" flag that accepts either "blobless" or "treeless", and implements the corresponding filter options in the clone command.
- Added a new "partial" flag in commands.go with validation.
- Updated clone logic in vcs.go to incorporate filter options for partial clones.
- Expanded test coverage for the new partial clone functionality in cmd_get_test.go, vcs_test.go, commands_test.go, and getter.go.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| commands.go | Added a new flag for partial clones with validation. |
| cmd_get_test.go | Added test cases for blobless, treeless, and invalid partial options. |
| vcs.go | Implemented filter options based on partial flag values. |
| vcs_test.go | Added tests to verify partial clone filter flags in git commands. |
| commands_test.go | Updated clone argument structure to include the partial flag. |
| getter.go | Propagated the partial option to the repository getter. |
| cmd_get.go | Passed the partial flag from CLI to the clone options. |
Comments suppressed due to low confidence (1)
commands.go:48
- [nitpick] Consider including the allowed values in the error message for improved clarity, e.g., "flag partial value "%v" is not allowed; allowed values are 'blobless' or 'treeless'".
return fmt.Errorf("flag partial value \"%v\" is not allowed", v)
|
All checks have been completed and there appear to be no review comments by Copilot. |
|
Thank you. I think this is a very good pull request. However, while "blobless" and "treeless" are well-known idioms, I'm not sure whether it's okay to take them as arguments as they are. Do you know of any other tools that take arguments like that? If there are no other tools with such an argument system, I think it would be good to add a |
|
Thank you. I was not able to take into account the implementation trends of other commands......
For other common Git helpers, I investigated support for the
It will not be consistent with the existing |
filter option on Git repository
|
You're right, it's not consistent with the shallow command... I'm starting to think it's OK as it is. |
|
OK. I would like to accept your original changes. Sorry for the confusion. @RShirohara |
filter option on Git repository66a700e to
39c5d07
Compare
|
There was a conflict, which has been resolved, and i have confirmed that all unit tests pass on local. |
|
Thank you! |
Description
Add partial clone support to Git repository. (Resolves #370)
Suggestion
Add
--partialoption toghq getfor partial clone.The
--partialoption can specify eitherbloblessortreeless, and each corresponding to the--filteroption ingit clone.blobless:--filter=blob:nonetreeless:--filter=tree:0Example
In blobless clone:
In treeless clone: