Initial commit: Git OpenTimestamp hooks skill

This commit is contained in:
Otto 2026-03-08 00:12:45 +01:00
commit eec64d16c6
13 changed files with 1145 additions and 0 deletions

32
scripts/pre-commit-backfill Executable file
View file

@ -0,0 +1,32 @@
#!/bin/bash
# Pre-commit hook: backfill proofs for all commits before creating new commit
# This ensures all historical commits have attested proofs
set -e
# Get the directory where this hook is installed
HOOKS_DIR="$(git rev-parse --git-dir)/hooks"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Find the backfill-proofs.sh script
BACKFILL_SCRIPT=""
if [ -f "$SCRIPT_DIR/backfill-proofs.sh" ]; then
BACKFILL_SCRIPT="$SCRIPT_DIR/backfill-proofs.sh"
elif [ -f ".git/hooks/backfill-proofs.sh" ]; then
BACKFILL_SCRIPT=".git/hooks/backfill-proofs.sh"
elif [ -f "backfill-proofs.sh" ]; then
BACKFILL_SCRIPT="./backfill-proofs.sh"
elif [ -f "$HOME/.openclaw/workspace/skills/git-ots-hook/scripts/backfill-proofs.sh" ]; then
BACKFILL_SCRIPT="$HOME/.openclaw/workspace/skills/git-ots-hook/scripts/backfill-proofs.sh"
else
# Silently skip if backfill script not found
exit 0
fi
chmod +x "$BACKFILL_SCRIPT"
echo "[ots] Backfilling proofs before commit..."
"$BACKFILL_SCRIPT" .
echo "[ots] Ready to commit"