FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: hook identity, user-defined commit rules, a wider lock and an uninstall (0.6.0) by JheisonMB · Pull Request #20 · UniverLab/gitkit · GitHub

feat: hook identity, user-defined commit rules, a wider lock and an uninstall (0.6.0) - #20

Merged
JheisonMB merged 8 commits into
developfrom
feature/gitkit-0.6.0
Aug 26, 2026
Merged

feat: hook identity, user-defined commit rules, a wider lock and an uninstall (0.6.0)#20
JheisonMB merged 8 commits into
developfrom
feature/gitkit-0.6.0

Conversation

Copy link
Copy Markdown
Collaborator

Four defects and gaps, run through the loop with a qwen3.7-plus implementer and a claude-sonnet-5 reviewer/committer.

GK-E — an outdated builtin is recognised, not frozen (eafee0e)

detect_builtin compared the entire script, character for character, against the current version:

.find(|b| b.hook == hook_file && content.trim() == b.script.trim())

So any change to a builtin's script — a typo fix, a new vendor address, a reworded error — orphaned every repository running the previous version. The migration then absorbed it as 00-preexisting, a hand-written hook gitkit will never touch again, and the user kept running the old rule while seeing a successful install. Builtins now carry an identity marker; exact-content matching stays as the fallback for hooks installed before it existed.

GK-H — commit rules the user defines (914ab41)

The commit-msg builtins were closed: conventional-commits, no-body, no-trailers. A team with a JIRA prefix, a length limit or another language had nowhere to hang it and ended up hand-writing the hook, which is what gitkit exists to prevent. message-rules takes named regex rules from the repo's config — each with its own help text, positive or negative, scoped to the subject or the whole message. Patterns are validated when configured, not at someone else's first commit.

This closes GK-G too, deliberately. Copilot smuggles a trailer into the subject after a semicolon, and no-trailers misses it because its pattern is anchored to line start. A negative subject-scoped rule covers it without a dedicated builtin — the general mechanism was worth more than the specific patch.

GK-F — the lock reaches further (4d0d644)

It blocked commit and push; everything else a rewrite can do went through untouched, which is a strange shape for a feature meant to hold a repository still. pre-rebase joins the default. Reference protection is a separate opt-in axis (--refs), never folded into --all: it is the only lock --no-verify cannot bypass, and that power is worth an explicit choice rather than a surprise.

GK-UNIN — an uninstall that cleans up after itself (e832135)

gitkit writes into other people's repositories and had no way out. gitkit uninstall shows its plan and asks first, removes gitkit's parts from every repository in the machine-wide registry, and restores any hand-written hook it had absorbed. Registry entries whose repositories are gone are reported and skipped. It never removes the binary, and says so.


Gate green at every commit: cargo fmt --all, cargo clippy --all-targets -- -D warnings, 673 tests.

JheisonMB merged commit 737de9a into develop Aug 26, 2026
4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL