From dd8b24a16ec8a2a540fefa7f42775acfdec7717d Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Thu, 16 Apr 2026 17:11:30 -0400 Subject: [PATCH] fix(quick): rescue uncommitted SUMMARY.md before worktree removal (#2296) (#2326) Mirrors the safety net from execute-phase.md (#2070): checks for any uncommitted SUMMARY.md files in the executor worktree before force-removing it, commits them to the branch, then merges the branch to preserve the data. Closes #2296 Co-authored-by: Claude Sonnet 4.6 --- get-shit-done/workflows/quick.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/get-shit-done/workflows/quick.md b/get-shit-done/workflows/quick.md index 69d872b8a..5c4a6ce57 100644 --- a/get-shit-done/workflows/quick.md +++ b/get-shit-done/workflows/quick.md @@ -660,6 +660,15 @@ After executor returns: fi fi + # Safety net: rescue uncommitted SUMMARY.md before worktree removal (#2296, mirrors #2070) + UNCOMMITTED_SUMMARY=$(git -C "$WT" ls-files --modified --others --exclude-standard -- "*SUMMARY.md" 2>/dev/null || true) + if [ -n "$UNCOMMITTED_SUMMARY" ]; then + echo "⚠ SUMMARY.md was not committed by executor — committing now to prevent data loss" + git -C "$WT" add -- "*SUMMARY.md" 2>/dev/null || true + git -C "$WT" commit --no-verify -m "docs(recovery): rescue uncommitted SUMMARY.md before worktree removal (#2070)" 2>/dev/null || true + git merge "$WT_BRANCH" --no-edit -m "chore: merge rescued SUMMARY.md from executor worktree ($WT_BRANCH)" 2>/dev/null || true + fi + git worktree remove "$WT" --force 2>/dev/null || true git branch -D "$WT_BRANCH" 2>/dev/null || true fi