Skip to content

Fix git in snapshots and remove commit replay#82

Merged
JAORMX merged 1 commit intomainfrom
git-rework
Mar 24, 2026
Merged

Fix git in snapshots and remove commit replay#82
JAORMX merged 1 commit intomainfrom
git-rework

Conversation

@JAORMX
Copy link
Copy Markdown
Contributor

@JAORMX JAORMX commented Mar 24, 2026

Stop breaking git inside workspace snapshots. Three key changes:

  1. Remove .git/config from snapshot security patterns — the file is now
    copied normally and sanitized by the ConfigSanitizer post-processor.
    The sanitizer no longer destroys worktree .git files; it resolves the
    config path through the gitdir/commondir chain within the snapshot.

  2. Narrow diff security patterns from .git (entire directory) to
    .git/config and .git/hooks/ — objects, refs, HEAD, and branches now
    sync back so agent git operations (commits, branches, push) persist.
    Hooks are blocked at the diff layer as defense-in-depth.

  3. Delete the commit replay mechanism (~960 lines) — with .git/ state
    syncing back naturally through the flush pipeline, the fragile
    replay that couldn't handle branches, merges, or divergence is no
    longer needed.

Fixes #49

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Stop breaking git inside workspace snapshots. Three key changes:

1. Remove .git/config from snapshot security patterns — the file is now
   copied normally and sanitized by the ConfigSanitizer post-processor.
   The sanitizer no longer destroys worktree .git files; it resolves the
   config path through the gitdir/commondir chain within the snapshot.

2. Narrow diff security patterns from .git (entire directory) to
   .git/config and .git/hooks/ — objects, refs, HEAD, and branches now
   sync back so agent git operations (commits, branches, push) persist.
   Hooks are blocked at the diff layer as defense-in-depth.

3. Delete the commit replay mechanism (~960 lines) — with .git/ state
   syncing back naturally through the flush pipeline, the fragile
   replay that couldn't handle branches, merges, or divergence is no
   longer needed.

Fixes #49

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JAORMX JAORMX requested a review from jhrozek March 24, 2026 08:39
@JAORMX JAORMX merged commit 70eca02 into main Mar 24, 2026
8 checks passed
@JAORMX JAORMX deleted the git-rework branch March 24, 2026 08:43
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.

Worktree snapshots lack object database — git shows "No commits yet"

1 participant