forked from ProverCoderAI/docker-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpre-push
More file actions
executable file
·23 lines (19 loc) · 998 Bytes
/
pre-push
File metadata and controls
executable file
·23 lines (19 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
set -euo pipefail
# NOTE: pre-commit splits/redacts knowledge files before they land in new commits.
# pre-push is a safety net: it prevents pushing commit ranges containing oversized or secret blobs
# under any nested .knowledge/.knowlenge path.
if [ "${DOCKER_GIT_SKIP_KNOWLEDGE_GUARD:-}" = "1" ]; then
exit 0
fi
node scripts/pre-push-knowledge-guard.js "$@"
# CHANGE: backup AI session to a private session repository on push (supports Claude, Codex, Gemini)
# WHY: allows returning to old AI sessions and provides PR context without gist limits
# QUOTE(ТЗ): "когда происходит push мы сразу заливаем текущую сессию с AI агентом в gits приватный"
# REF: issue-143
# PURITY: SHELL
if [ "${DOCKER_GIT_SKIP_SESSION_BACKUP:-}" != "1" ]; then
if command -v gh >/dev/null 2>&1; then
node scripts/session-backup-gist.js --verbose || echo "[session-backup] Warning: session backup failed (non-fatal)"
fi
fi