pub fn compute_patchset(
workspace_path: &Path,
base_epoch: &EpochId,
) -> Result<PatchSet, DiffError>Expand description
Compute a PatchSet from a workspace’s current working directory state
relative to the given base epoch commit.
§Arguments
workspace_path— absolute path to the workspace working directory.base_epoch— the epoch commit to diff against (an ancestor of the workspace’s current state).
§What this does
- Runs
git diff --find-renames --name-status <epoch>to detect tracked changes: added, modified, deleted, and renamed files. - Runs
git ls-files --others --exclude-standardto collect untracked files (new files not yet staged), recording them asAddentries. - For each change, computes the relevant blob OIDs:
- Working-directory file content →
git hash-object -w - Epoch tree blob →
git rev-parse <epoch>:<path>
- Working-directory file content →
§FileId note
FileIds come from .manifold/fileids when available, with deterministic
fallbacks for repositories that do not yet have an identity map.
§Errors
Returns DiffError if any git command fails or produces unexpected output.