vault-sync scripts: scope add to the vault tree, commit before pull, per-commit identity, autostash

This commit is contained in:
jimmy
2026-09-13 12:00:35 -07:00
parent 73d0bb986b
commit c7e847e4d4
2 changed files with 33 additions and 16 deletions
+6 -5
View File
@@ -1,16 +1,15 @@
#!/usr/bin/env bash
# Zero-token vault change log
# Dumps raw git log to a file for agents to read
# Dumps raw git log to a file for agents to read.
VAULT_DIR="/c/Users/fight/AgentOS/memory-systems/agent-os"
LOG_FILE="$VAULT_DIR/03_shared/vault-updates-log.md"
cd "$VAULT_DIR" || exit 1
# Pull latest first
git pull --rebase 2>&1 > /dev/null
# Refresh from remote first (best-effort: --rebase refuses on a dirty tree).
git pull --rebase > /dev/null 2>&1
# Generate the log
{
echo "# Vault Updates Log"
echo ""
@@ -32,7 +31,9 @@ git pull --rebase 2>&1 > /dev/null
echo ""
echo "## Files Changed (Last 24h)"
echo ""
git diff --name-only HEAD@{24.hours.ago} HEAD 2>/dev/null || echo "No recent file changes."
# `HEAD@{24.hours.ago}` fails on a young reflog; derive the list from the log instead.
git log --since="24 hours ago" --name-only --pretty=format: -- . 2>/dev/null \
| sed '/^[[:space:]]*$/d' | sort -u
} > "$LOG_FILE"
echo "Vault change log updated: $LOG_FILE"