Expand description
PatchSet computation from working directory diff (§5.4).
Builds a PatchSet by comparing a workspace’s working directory against
a base epoch commit using git diff and git ls-files.
§Overview
compute_patchset does three things:
- Runs
git diff --find-renames --name-status <epoch>inworkspace_pathto enumerate tracked changes (added, modified, deleted, renamed files). - Runs
git ls-files --others --exclude-standardto collect untracked files, recording each as an additionalPatchValue::Addentry. - For each change, looks up or computes the relevant blob OID(s) using
git hash-object -wandgit rev-parse <epoch>:<path>.
§FileId allocation
File identity is resolved in this order:
.manifold/fileidsmapping (when present) for stable cross-run IDs.- Deterministic fallback from the epoch blob OID (existing files).
- Deterministic fallback from path hash (new files not yet in map).
§Example flow
compute_patchset(repo_root, workspace_path, &epoch)
├── git diff --find-renames --name-status <epoch> → A/M/D/R lines
├── git ls-files --others --exclude-standard → untracked paths
├── git hash-object -w <file> → new blob OIDs
└── git rev-parse <epoch>:<path> → base blob OIDsEnums§
Functions§
- compute_
patchset - Compute a
PatchSetfrom a workspace’s current working directory state relative to the given base epoch commit.