From 45035b7f94e73784fef3ddb37f9e56a13823667b Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 9 Sep 2026 02:50:32 +0000 Subject: [PATCH] fix(gstack-memorable): compat_check reads list-items output before grepping Under pipefail, piping the probe straight into grep -q let a non-zero probe exit mask the match, so a hook manager without list-items was sometimes reported as compatible. Capture the output, then grep. Co-Authored-By: Claude Fable 5.1 --- bin/gstack-memorable | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/gstack-memorable b/bin/gstack-memorable index eef7027a8..e00bedda7 100755 --- a/bin/gstack-memorable +++ b/bin/gstack-memorable @@ -179,7 +179,11 @@ compat_check() { _err "the stable install at $CANONICAL_GSTACK_ROOT is version '${there:-unknown}' but this tree is '$here'; run ./setup so the registered hook is the code that will run" return 1 fi - if "$SETTINGS_HOOK" list-items 2>&1 | grep -q "Unknown action"; then + # Captured, not piped: under pipefail the probe's own non-zero exit would + # mask a matching grep and let an old hook manager through. + local probe + probe="$("$SETTINGS_HOOK" list-items 2>&1)" || true + if printf '%s' "$probe" | grep -q "Unknown action"; then _err "the stable install's hook manager does not know list-items; run ./setup first"; return 1 fi return 0