From a27a3d02b09a09fa0b02e21bbf1ade3d1d46d59d Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Sun, 3 May 2026 15:57:08 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20pre-commit=20hook=20=E2=80=94=20handle?= =?UTF-8?q?=20non-lisp=20org=20files=20(no=20:tangle=20header)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The set -euo pipefail combined with grep returning non-zero on files without a :tangle header (like ROADMAP.org) caused the hook to abort silently, preventing commits. Added || true to the grep pipeline. --- scripts/pre-commit-repl-check | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pre-commit-repl-check b/scripts/pre-commit-repl-check index 0169c01..6825d02 100755 --- a/scripts/pre-commit-repl-check +++ b/scripts/pre-commit-repl-check @@ -35,7 +35,7 @@ for orgfile in $CHANGED; do [ -f "$orgfile" ] || continue # Determine the tangle target from the org file's PROPERTY line - TANGLE=$(grep 'header-args.*:tangle' "$orgfile" | sed "s/.*:tangle //" | head -1) + TANGLE=$(grep 'header-args.*:tangle' "$orgfile" | sed "s/.*:tangle //" | head -1 || true) if [ -z "$TANGLE" ]; then echo "SKIP: $orgfile — no :tangle header" >&2 continue @@ -48,7 +48,7 @@ for orgfile in $CHANGED; do # Tangle the org file to lisp if ! emacs --batch -L "$PROJECT_DIR" --eval "(require 'ob-tangle)" \ --eval "(org-babel-tangle-file \"$ORG_DIR/$(basename "$orgfile")\")" \ - 2>/dev/null; then + /dev/null; then echo "FAIL: $orgfile — tangling failed" >&2 FAILED=1 continue @@ -62,7 +62,7 @@ for orgfile in $CHANGED; do # Compile the lisp file in the daemon. # We send a Lisp form that compiles the file and returns T or an error string. # Using format to avoid backquote/comma issues. - LISP_ABS=$(realpath "$LISP_FILE") + LISP_ABS=$(realpath "$LISP_FILE" 2>/dev/null || echo "$LISP_FILE") CODE=$(cat <<-LISPEOF (let ((*standard-output* (make-broadcast-stream)) (*error-output* (make-broadcast-stream)))