fix: support overlay copy for directory sync#32
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the directory synchronization behavior in Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements the overlay copy behavior for directory syncs, including updates to sync, unsync, and status logic. The changes are well-tested and the documentation has been updated accordingly across all languages.
My review found a recurring pattern in the new code where errors are returned without being wrapped with additional context. This violates rule #17 of the repository's Go style guide. I've left a couple of comments with suggestions to address this, which will improve debuggability. Overall, this is a solid contribution.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant enhancement by adding overlay copy support for directory synchronization. The implementation is robust, including comprehensive updates to documentation across multiple languages and thorough test coverage for the new functionality. I've identified a couple of areas for improvement in the Go code to enhance error handling and security consistency.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces an "overlay-copy" behavior for directories in git-volume's copy mode. This change ensures that when copying directories, sync will overlay source entries into the target, preserving unrelated files, replacing conflicting files/symlinks, and safely failing on file-vs-directory conflicts. The status and unsync commands have been updated to operate on this copied subset. The documentation in README.md and its translations has been updated to reflect these changes. A review comment suggests improving the readability of the new overlay behavior description in the README.md files by converting it into a bulleted list for better clarity.
|
|
||
| ### Copy-mode directory behavior | ||
|
|
||
| When `mode: "copy"` uses a directory source, `sync` overlays the source entries into the target directory instead of deleting the target root directory. Existing unrelated files are preserved, file/symlink conflicts are replaced, and file-vs-directory conflicts fail safely. `status` and `unsync` operate on the copied source subset rather than requiring the whole target directory to match exactly. |
There was a problem hiding this comment.
This paragraph contains a lot of important information about the new overlay behavior. To improve readability, consider breaking it down into a bulleted list. This will make it easier for users to quickly understand the different aspects of the copy mode for directories.
For example:
When `mode: "copy"` is used with a directory source, the behavior is as follows:
* **`sync`**: Overlays source entries into the target directory.
* The target root directory is not deleted.
* Existing unrelated files are preserved.
* File/symlink conflicts are replaced by the source entry.
* File-vs-directory conflicts cause the operation to fail safely.
* **`status` & `unsync`**: Operate only on the set of files copied from the source, ignoring other files in the target directory.This suggestion should also be applied to the translated README.md files in docs/translations/.
Summary
Testing