Add worktree controls and upgrade git-internal - #30
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 053c34bde0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if entry.cl.is_some() { | ||
| return Err(ServiceError::InvalidRequest( | ||
| "cannot bind a Libra worktree base to a mount with a CL layer".into(), | ||
| )); |
There was a problem hiding this comment.
Reject CL remounts after binding a worktree base
This only rejects a CL layer that exists at bind time, but the existing POST /mounts/{id}/cl path can still be called after a clean mount is bound because build_cl never checks base_revision. In the sequence create clean mount → bind base → build CL, the visible FUSE tree is remounted with CL overrides while /worktree still reports the same base_revision and dirty=false because CL entries are excluded there, so Libra can compute status or refresh decisions against a different tree than users see. Please reject CL changes once base_revision is set, or clear the binding before allowing the CL remount.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 584abf0800
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let state = self.worktree_state(mount_id).await?; | ||
| if state.dirty { | ||
| return Err(ServiceError::InvalidRequest( | ||
| "cannot bind a worktree base after local upper-layer changes exist".into(), |
There was a problem hiding this comment.
Allow idempotent base rebinds on dirty mounts
When a mount is already bound and then gets local upper-layer edits, retrying POST /worktree/base with the same base_revision now returns INVALID_REQUEST because the dirty check runs before the existing-base idempotency check. The new worktree contract documents same-base binding as idempotent, so client retries or reconciliation after any write will fail even though they are not changing the base; please allow an existing identical binding before rejecting dirty uppers.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ead0a035ce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if entry.cl.is_some() { | ||
| return Err(ServiceError::InvalidRequest( | ||
| "cannot bind a Libra worktree base to a mount with a CL layer".into(), | ||
| )); |
There was a problem hiding this comment.
Reject base binds while a CL remount is quiescing
Even with the new build_cl guard, /worktree/base can still race with an initial /cl request: build_cl sets the mount to Quiescing and drops the lock while entry.cl is still None, so this check can pass and set base_revision; when the in-flight CL remount later finishes, it does not recheck the base and leaves a bound Libra worktree with a CL layer. Please also reject non-Mounted/Ready states (or recheck in build_cl before committing the CL) so the documented CL-free base invariant cannot be violated under concurrent control-plane calls.
Useful? React with 👍 / 👎.
Summary
git-internalto 0.8.5 and version the sled object cache to JSON-backed v2 keysRoot cause
git-internal0.8.5 no longer implements bincode'sEncodeandDecodetraits forTreeandCommit. The cache now uses the dependency's supported Serde implementation and isolates old cache entries with a v2 key namespace.Validation
cargo check