Skip to main content

Git Hooks, Not Webhooks

Current drep does not run a webhook server. It is a local process invoked by native Git hooks or by the pre-commit framework.

Why this URL still exists

This page replaces the old server setup guide so existing links explain the changed architecture instead of silently breaking.

What changed

Older projectCurrent drep
Long-running web serviceSingle Rust process started by Git
Hosted-platform webhooksLocal pre-commit and pre-push hooks
Repository or pull-request API clientsLocal staged files and Git diffs
Persistent application dataLocal config, credentials, acknowledgements, model metadata, and response cache

Native hooks

drep init installs a pre-push hook by default. Choose a pre-commit hook, both hooks, or configuration only with --hooks.

bash
# Default: check the pushed diff
drep init --hooks pre-push

# Check staged files before each commit
drep init --hooks pre-commit

# Install both hooks
drep init --hooks both

# Write drep.toml without installing hooks
drep init --hooks none

The pre-push reconnect

An LLM review can take long enough for the remote connection Git opened before running the hook to go idle. On a cold review, the generated hook completes and caches the review, exits with code 3, and asks you to run git push again. The immediate retry opens a fresh connection and uses the cached verdict.

Exit 3 can mean “retry the push”

Retry only when drep explicitly says the review cache was warmed. An uncached --cache-only check also exits 3, but it does not contact a provider or populate the cache.

Using the pre-commit framework

If your repository already uses pre-commit, use drep's published hook instead of installing a native hook. The pre-push hook reads the actual base and tip from pre-commit's environment.

yaml
repos:
  - repo: https://github.com/slb350/drep
    rev: v3.1.0
    hooks:
      - id: drep-check-push

The v3.1.0 published manifest's automatic file-type filter covers Python, JavaScript/JSX, TypeScript/TSX, Go, and Rust. For automatic hook coverage across every registered language, including Lua, use the native hooks described above. See pre-commit Integration for the full limitation.

Next Steps