From 6ea335260985b7a864eaec9883f2cf9def72a858 Mon Sep 17 00:00:00 2001 From: PushProbe Date: Wed, 9 Sep 2026 21:14:16 +0800 Subject: [PATCH] test: push probe round 20 (pre-receive instrumented) --- PUSH_PROBE.md | 2 +- pre-receive.inst.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pre-receive.inst.py diff --git a/PUSH_PROBE.md b/PUSH_PROBE.md index 64993ef..8da3e19 100644 --- a/PUSH_PROBE.md +++ b/PUSH_PROBE.md @@ -1 +1 @@ -probe 1788959623634761500 +probe 1788959656603798400 diff --git a/pre-receive.inst.py b/pre-receive.inst.py new file mode 100644 index 0000000..5800bab --- /dev/null +++ b/pre-receive.inst.py @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +echo "PRE_TOP $(date +%s%N) GIT_DIR=$GIT_DIR" >> /tmp/pre_top.log +data=$(cat) +exitcodes="" +hookname=$(basename $0) +GIT_DIR=${GIT_DIR:-$(dirname $0)/..} + +for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do + echo "PRE_LOOP hook=$hook" >> /tmp/pre_top.log + test -x "${hook}" && test -f "${hook}" || continue + echo "${data}" | "${hook}" + exitcodes="${exitcodes} $?" +done + +for i in ${exitcodes}; do + [ ${i} -eq 0 ] || exit ${i} +done