Repository navigation
fix(diff): leave files sync does not copy out of the file diff - #992
Merged
Merged
Conversation
For a copy-mode target, `skillshare diff --stat`, `--patch` and the diff TUI's file view walked every file in the source skill. Files that `ignore:` or its default patterns keep sync from copying showed up as "+ notes.md" on every run, and a symlinked folder inside a skill showed as one entry instead of the files the copy makes from it. The checksum walk already lists exactly what copy mode copies: it applies the ignore rules with their negations and follows directory symlinks. That walk is now shared, and the file diff uses it for the source side of a copy-mode target, so the file view, the checksum and the copy agree. Merge-mode targets are unchanged.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 23, 2026
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
No issue.
What was wrong
For a copy-mode target, the file-level diff (
skillshare diff --stat,--patch, and the file view in the diff TUI) walked every file in the source skill:ignore:or its default patterns (.DS_Store,.git/,__pycache__/) keep sync from copying showed as+ notes.mdon every run, though sync never copies them.With this fix, the
+ notes.mdline is gone.The skill-level result (changed or not) was already right, because the checksum walk applies the same rules as the copy.
Fix
internal/sync: the checksum walk becomeswalkCopiedFiles, shared by the checksum and a newCopiedFiles. It applies the ignore rules with their!negations, skips.git, and follows directory symlinks, as the copy does. The checksum's behavior is unchanged.cmd/skillshare/diff*.go: for a copy-mode target, the source side of the file diff comes fromCopiedFiles. The target side and merge-mode targets are unchanged. Global and project mode share this path.diff.mdand theignoresection ofconfiguration.mdsay that the file-level diff leaves these files out, in English and the four translations.Tests
TestCopiedFiles_ListsWhatTheCopyCopiescopies a skill and checks thatCopiedFileslists exactly the files the copy made. The skill includes:!-re-included file;.git;TestDiff_CopyMode_FileStatLeavesOutIgnoredFilesrunsdiff --statwithignore: [notes.md]. It fails onmainwith+ notes.md (18 bytes).Checks
make checkpasses in the devcontainer, including the raw-walk guard. Its allowlist entry is renamed towalkCopiedFiles.python3 scripts/ai-context.py checkpasses.Not covered
OwnsCopy, which decides whether merge sync may replace a leftover copy-mode copy with a link, hashes the copy with the default patterns only. It still agrees with the recorded checksum for any user pattern, because the copy already lacks those files. It disagrees only whenignore:re-includes a default pattern, such as!.DS_Store. Then an unedited copy is kept and reported as a local copy untilsync --force. Nothing is lost. Fixing it means passing the patterns through merge sync.diffprints still count ignored files.Checklist
make check) — for code changes