From aebc607e098e101e5d4dd54aba66ac91ad8ab909 Mon Sep 17 00:00:00 2001 From: dietrich ayala Date: Tue, 11 Aug 2026 21:25:30 +0200 Subject: [PATCH] replace the delivered staging directories rather than extracting over them `git archive | tar -x` adds and overwrites but never removes, so a file deleted from ~/.claude or ~/misc/chook stayed in ~/claude-config on the box forever, and 22-claude-config.sh re-delivered it from there on every run. Un-adopting a project looked complete on the laptop and in git while the box kept receiving the directory that had been removed. laptop/sync-config.sh's sync_tree() already clears its destination for exactly this reason, and the reason it is safe applies here too: these are staging directories that only phase 2 writes and only 22-claude-config.sh reads. --- bootstrap.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 9a5f470..21c9562 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -298,7 +298,13 @@ check_clean() { deliver_repo() { local src=$1 remote_dir=$2 label=$3 dest=$4 commit commit=$(git -C "$src" rev-parse HEAD) || die "could not resolve HEAD for $label ($src)" - ssh "${SSH_OPTS[@]}" "$FLIT_USER@$dest" "mkdir -p ~/$remote_dir" \ + # Replaced, not extracted over. `git archive | tar -x` never removes + # anything, so a file deleted from the source repository used to live in the + # staging directory forever and be re-delivered from there on every run — the + # same defect laptop/sync-config.sh's sync_tree() clears its destination to + # avoid, and it is safe here for the same reason: this directory is staging + # that only phase 2 writes and only server/lib/22-claude-config.sh reads. + ssh "${SSH_OPTS[@]}" "$FLIT_USER@$dest" "rm -rf ~/$remote_dir && mkdir -p ~/$remote_dir" \ || die "could not create ~/$remote_dir on $dest" git -C "$src" archive HEAD \ | ssh "${SSH_OPTS[@]}" "$FLIT_USER@$dest" "tar -x -C ~/$remote_dir" \ -- 2.51.2