fix(git): scope commit staging to dataset - #207
Closed
presempathy-awb wants to merge 1 commit into
Closed
Conversation
zhangfengcdt
approved these changes
Aug 25, 2026
zhangfengcdt
left a comment
Owner
There was a problem hiding this comment.
Reviewed: implementation and tests pass; no public API surface change detected.
Owner
|
Resolved and integrated via #246 after the full CI matrix passed. |
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.
Git Commits Stage Only the Dataset
Bug
GitVersionedKvStore::commitstaged the whole repository with a repo-rootgit add -A .before writing the tree. A dataset commit could accidentally include unrelated files from the parent Git repository.Impact
git-prollydatasets are intended to live in subdirectories. In that layout, a normal data commit could capture unrelated source files, scratch files, credentials, or other sibling project state. The bug also made tests and local worktree hygiene misleading because committing a key-value change mutated the broader Git index.Root Cause
Commit creation knew the Git root but did not pass the dataset directory into the staging helper. The helper therefore staged from the repository root instead of the dataset-relative path.
Regression Proof
test_commit_does_not_stage_unrelated_repo_root_filewritesunrelated.txtat the repository root, commits a key under the dataset, then inspects the commit tree. Onmain, the unrelated root file is present in the commit tree. The correct behavior is that onlydataset/...entries are included.Fix
The branch threads
dataset_dirintostage_and_write_tree, canonicalizes both paths, refuses to stage the repository root as a dataset, and runs:The same scoped staging path is used by the backend commit flow, so normal commits still include all dataset changes without crossing the dataset boundary.
Verification
Run from a temporary target directory: