Files
claudetools/.claude/memory/project_sync_script_bug.md
Mike Swanson 0897e5e317 fix(sync): detect untracked-only changes; reconcile timer-era memories
sync.sh: replace `git diff-index --quiet HEAD --` with
`[ -n "$(git status --porcelain)" ]` in both the main-repo (Phase 1) and
vault change-detection, so brand-new untracked files are no longer silently
skipped (the bug Howard hit 2026-04-17). Mark project_sync_script_bug.md
RESOLVED.

.gitignore: exclude the datto BSOD dumps (6 MB zip + 48 MB extracted) so the
detection fix doesn't sweep 54 MB of binaries into the repo.

memory: finish the add_line_item reconciliation — drop legacy "time entry" /
timer-billable framing from feedback_syncro_labor_type and
feedback_syncro_warranty_product (and their index lines); the product-selection
rules themselves are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 10:19:52 -07:00

1.6 KiB

name, description, type
name description type
Sync script bug — untracked files RESOLVED 2026-05-21 — sync.sh now uses git status --porcelain (catches untracked-only changes) in both repo and vault detection. project

RESOLVED 2026-05-21. Fixed in .claude/scripts/sync.sh: both the main-repo (Phase 1) and vault change-detection now use if [ -n "$(git status --porcelain)" ] instead of git diff-index --quiet HEAD --, so untracked-only changes are caught. A .gitignore entry was added for the datto BSOD dumps (54 MB binary) so the fix doesn't sweep them in. Original report retained below.

.claude/scripts/sync.sh line 53 uses git diff-index --quiet HEAD -- to detect local changes. This only flags tracked files with modifications. Brand-new untracked files (a new report, new session log, new memory) will NOT be detected on their own — they only get swept up when a tracked file is also dirty (because git add -A then runs).

Symptom seen 2026-04-17 by Howard: added a single new report file, ran /sync, script said "No local changes to commit" and did nothing. Workaround was git add <file> first, then re-run.

Why: git diff-index ignores untracked files by design. Needs git status --porcelain (any output = changes) or equivalent.

How to apply: Mike — small one-line fix in .claude/scripts/sync.sh. Suggested replacement:

# Before (line 53):
if ! git diff-index --quiet HEAD -- 2>/dev/null; then

# After:
if [ -n "$(git status --porcelain)" ]; then

Also applies to the Sync Summary's git diff --stat $LOCAL_BEFORE..HEAD — may need review to make sure the summary range still makes sense after the detection fix.