Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .githooks/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
# post-checkout hook - runs deepwork install when switching branches
#
# Arguments:
# $1 - ref of the previous HEAD
# $2 - ref of the new HEAD
# $3 - flag: 1 = branch checkout, 0 = file checkout

OLD_REF="$1"
NEW_REF="$2"
CHECKOUT_TYPE="$3"

# Only run on branch checkouts, not file checkouts
if [ "$CHECKOUT_TYPE" != "1" ]; then
exit 0
fi

# Only run if the branch actually changed
if [ "$OLD_REF" = "$NEW_REF" ]; then
exit 0
fi

# Check if deepwork command is available
if ! command -v deepwork >/dev/null 2>&1; then
exit 0
fi

echo "Branch changed, running deepwork install..."
deepwork install
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ export PYTHONPATH="$PWD/src:$PYTHONPATH"
export DEEPWORK_DEV=1
```

### Setting Up Git Hooks

The repository includes git hooks that automatically run `deepwork install` when you switch branches, keeping your local deepwork configuration in sync. To enable them:

```bash
# Configure git to use the project's hooks directory
git config core.hooksPath .githooks
```

This only needs to be done once per clone.

## Installing DeepWork Locally

To use your local development version of DeepWork, install it in **editable mode**. This allows you to make changes to the code and have them immediately reflected without reinstalling.
Expand Down