Commit 8f4923bc authored by Jan Reimes's avatar Jan Reimes
Browse files

chore(hooks): update hooks to v0.61.0 with timeout handling

* Added timeout handling for hooks to prevent indefinite blocking.
* Updated version markers to v0.61.0 across all hook scripts.
* Enhanced error messaging for uninitialized databases.
* Improved runtime file management in .gitignore.
parent 5137f0e0
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -7,6 +7,20 @@ bd.sock
bd.sock.startlock
sync-state.json
last-touched
.exclusive-lock
.beads-credential-key

# Daemon runtime (lock, log, pid)
daemon.*

# Interactions log (runtime, not versioned)
interactions.jsonl

# Push state (runtime, per-machine)
push-state.json

# Lock files (various runtime locks)
*.lock

# Local version tracking (prevents upgrade notification spam after git ops)
.local_version
@@ -31,8 +45,9 @@ dolt-server.pid
dolt-server.log
dolt-server.lock
dolt-server.port
dolt-server.activity
dolt-monitor.pid

# Corrupt backup directories (created by bd doctor --fix recovery)
*.corrupt.backup/

# Backup data (auto-exported JSONL, local-only)
backup/
+19 −4
Original line number Diff line number Diff line
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v0.59.0 ---
# --- BEGIN BEADS INTEGRATION v0.61.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
  export BD_GIT_HOOK=1
  _bd_timeout=${BEADS_HOOK_TIMEOUT:-30}
  if command -v timeout >/dev/null 2>&1; then
    timeout "$_bd_timeout" bd hooks run post-checkout "$@"
    _bd_exit=$?
    if [ $_bd_exit -eq 124 ]; then
      echo >&2 "beads: hook 'post-checkout' timed out after ${_bd_timeout}s — continuing without beads"
      _bd_exit=0
    fi
  else
    bd hooks run post-checkout "$@"
  _bd_exit=$?; if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
    _bd_exit=$?
  fi
  if [ $_bd_exit -eq 3 ]; then
    echo >&2 "beads: database not initialized — skipping hook 'post-checkout'"
    _bd_exit=0
  fi
  if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v0.59.0 ---
# --- END BEADS INTEGRATION v0.61.0 ---
+19 −4
Original line number Diff line number Diff line
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v0.59.0 ---
# --- BEGIN BEADS INTEGRATION v0.61.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
  export BD_GIT_HOOK=1
  _bd_timeout=${BEADS_HOOK_TIMEOUT:-30}
  if command -v timeout >/dev/null 2>&1; then
    timeout "$_bd_timeout" bd hooks run post-merge "$@"
    _bd_exit=$?
    if [ $_bd_exit -eq 124 ]; then
      echo >&2 "beads: hook 'post-merge' timed out after ${_bd_timeout}s — continuing without beads"
      _bd_exit=0
    fi
  else
    bd hooks run post-merge "$@"
  _bd_exit=$?; if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
    _bd_exit=$?
  fi
  if [ $_bd_exit -eq 3 ]; then
    echo >&2 "beads: database not initialized — skipping hook 'post-merge'"
    _bd_exit=0
  fi
  if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v0.59.0 ---
# --- END BEADS INTEGRATION v0.61.0 ---
+19 −4
Original line number Diff line number Diff line
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v0.59.0 ---
# --- BEGIN BEADS INTEGRATION v0.61.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
  export BD_GIT_HOOK=1
  _bd_timeout=${BEADS_HOOK_TIMEOUT:-30}
  if command -v timeout >/dev/null 2>&1; then
    timeout "$_bd_timeout" bd hooks run pre-commit "$@"
    _bd_exit=$?
    if [ $_bd_exit -eq 124 ]; then
      echo >&2 "beads: hook 'pre-commit' timed out after ${_bd_timeout}s — continuing without beads"
      _bd_exit=0
    fi
  else
    bd hooks run pre-commit "$@"
  _bd_exit=$?; if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
    _bd_exit=$?
  fi
  if [ $_bd_exit -eq 3 ]; then
    echo >&2 "beads: database not initialized — skipping hook 'pre-commit'"
    _bd_exit=0
  fi
  if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v0.59.0 ---
# --- END BEADS INTEGRATION v0.61.0 ---
+19 −4
Original line number Diff line number Diff line
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v0.59.0 ---
# --- BEGIN BEADS INTEGRATION v0.61.0 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
  export BD_GIT_HOOK=1
  _bd_timeout=${BEADS_HOOK_TIMEOUT:-30}
  if command -v timeout >/dev/null 2>&1; then
    timeout "$_bd_timeout" bd hooks run pre-push "$@"
    _bd_exit=$?
    if [ $_bd_exit -eq 124 ]; then
      echo >&2 "beads: hook 'pre-push' timed out after ${_bd_timeout}s — continuing without beads"
      _bd_exit=0
    fi
  else
    bd hooks run pre-push "$@"
  _bd_exit=$?; if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
    _bd_exit=$?
  fi
  if [ $_bd_exit -eq 3 ]; then
    echo >&2 "beads: database not initialized — skipping hook 'pre-push'"
    _bd_exit=0
  fi
  if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v0.59.0 ---
# --- END BEADS INTEGRATION v0.61.0 ---
Loading