okl init --no-git-hook should remove okl's own pre-push hook, not just stop installing it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
Research direction
Start in cli/install.py, where the cfg["git_hook"] branch calls _install_git_hook, and inspect the existing --uninstall logic for ownership checks and user messaging. Add or locate tests for switching an installed-hook repo to --ci --no-git-hook, including the MODIFIED-hook case. Done means an untouched okl hook is removed with notice, while edited or third-party hooks are preserved and the user is told what to remove.
Written by the indexing model from the issue text.
Description
What happens
A repo whose earlier okl init installed the pre-push drift gate decides to gate drift in CI instead:
okl init --ci --no-git-hook
init installs the workflow and records git_hook: false, but the installed hook stays and keeps running. It still blocks every push on drift, so the switch to CI did not happen as the person meant.
Found by CodeRabbit on #146. The docs there now describe the behaviour as it is: "A hook an earlier init installed stays: --no-git-hook only stops init installing it, and okl init --uninstall removes it."
Cause
cfg["git_hook"] decides only whether _install_git_hook runs (cli/install.py, the if cfg["git_hook"] branch). Nothing removes okl's hook when the recorded choice turns false. The only code that deletes it is okl init --uninstall.
Proposal
When --no-git-hook is passed (or the recorded choice is false) and the hook in git's hooks directory is okl's own, untouched copy (ownership.status == OKL), remove it and say so. Leave an edited copy (MODIFIED) or another tool's hook alone, and print the line to take out instead, as --uninstall does today. Test it by switching a repo from the hook to --ci --no-git-hook, and check that an edited hook is kept.
🤖 Generated with Claude Code
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- Avg merge
- 5h 10m
- Merged PRs (30d)
- 127
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emeraldleaf/okl
-
enhancement loop-review
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
emeraldleaf/okl#190 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 50/100
emeraldleaf/okl#356 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
emeraldleaf/okl#349 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
emeraldleaf/okl#331 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 8/100
emeraldleaf/okl#329 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesOpenfollow-up
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Built-in QUBO fallback applies bitwise xor to floating binary statesPossibly taken @iloveeyjafjalla claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
qboson/kaiwu-pytorch-plugin#1702 ·
Maintainers usually reply within 3 days
-
bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/python-sdk#3811 ·
Maintainers usually reply within 1 day
-
cost:cheap practicality:seen-in-the-wild severity:medium
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Maintainers usually reply within 1 day