Skip to content

Stabilize COW Git snapshots#16

Merged
JanJakes merged 1 commit into
trunkfrom
codex/cow-stable-git-snapshots
May 6, 2026
Merged

Stabilize COW Git snapshots#16
JanJakes merged 1 commit into
trunkfrom
codex/cow-stable-git-snapshots

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

@adamziel adamziel commented May 5, 2026

What it does

Makes COW Git repository sync skip unchanged branch exports before writing a new snapshot commit. The adapter now compares the current Git tip tree with the proposed wordpress/ export plus generated database.sql.

Rationale

forkpress pull and agent worktrees depend on stable remote refs. If a clone/fetch path advances refs without a real WordPress file or database snapshot change, agents get noisy rebases and dirty-looking history.

Implementation

Adds cow_git_commit_matches_updates() and reuses a shared cow_git_blob_hash() helper. When the exported tree already matches the current commit, cow_git_sync_repository() skips the commit path entirely.

Testing instructions

php -d "extension=/home/claude/forkpress/ext/branchfs.so" tests/test_cow_git_server.php
make test-all
FORKPRESS_RUNTIME_BUNDLE=/dev/null cargo test -p forkpress
git diff --check

The new test_cow_git_server.php coverage asserts unchanged file/database snapshots keep the same ref, while real file and SQLite changes advance it.

@JanJakes JanJakes force-pushed the codex/cow-storage-lifecycle branch from 365f00c to 4dc4ef3 Compare May 6, 2026 16:02
@JanJakes JanJakes force-pushed the codex/cow-stable-git-snapshots branch from 4f83079 to 128fe3d Compare May 6, 2026 16:08
@JanJakes JanJakes changed the base branch from codex/cow-storage-lifecycle to trunk May 6, 2026 16:08
@JanJakes
Copy link
Copy Markdown
Contributor

JanJakes commented May 6, 2026

Reviewed and recorded follow-up notes under the PR #16 section in issue #30: #30 (comment)

@JanJakes JanJakes merged commit 5577d0b into trunk May 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants