Skip to content

Commit 3ed491b

Browse files
committed
docs: trim hook setup docs and add agents guide
1 parent 435ee07 commit 3ed491b

2 files changed

Lines changed: 6 additions & 46 deletions

File tree

‎AGENTS.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# AGENTS.md
2+
3+
## Common commands
4+
- Format: `make fmt`
5+
- Run tests: `make test`
6+
- Run full checks: `make ci`

‎README.md‎

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -149,52 +149,6 @@ git -C <path> worktreeinclude apply --json
149149
- Evaluate success by exit code
150150
- Use JSON `summary` and `actions` for details
151151

152-
## post-checkout auto-apply (manual setup)
153-
154-
This project does not auto-install hooks. Use manual setup.
155-
156-
### Shared hooks (recommended)
157-
158-
```sh
159-
mkdir -p .githooks
160-
cat > .githooks/post-checkout <<'EOF'
161-
#!/bin/sh
162-
set -eu
163-
164-
old="$1"
165-
if [ "$old" = "0000000000000000000000000000000000000000" ]; then
166-
git worktreeinclude apply --quiet || true
167-
fi
168-
EOF
169-
chmod +x .githooks/post-checkout
170-
git config core.hooksPath .githooks
171-
```
172-
173-
Generated `post-checkout`:
174-
175-
```sh
176-
#!/bin/sh
177-
set -eu
178-
179-
old="$1"
180-
if [ "$old" = "0000000000000000000000000000000000000000" ]; then
181-
git worktreeinclude apply --quiet || true
182-
fi
183-
```
184-
185-
- Runs only for newly created worktree/clone-style checkouts (`old` is 40 zeros)
186-
- Failure is non-fatal to avoid breaking checkout workflow
187-
188-
### Existing hook managers (husky, etc.)
189-
190-
- Do not overwrite existing `post-checkout`; append the `if` block.
191-
- If `core.hooksPath` is already configured, add the hook within that convention.
192-
193-
Notes:
194-
195-
- `git worktree add --no-checkout` may not trigger `post-checkout`.
196-
- In that case, run `git worktreeinclude apply` manually.
197-
198152
## Exit codes
199153

200154
- `0`: success

0 commit comments

Comments
 (0)