fix: add post-rebase uv-sync hook to prevent stale uv.lock after restack#300
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
Greptile SummaryThis PR adds Confidence Score: 5/5Safe to merge — correct implementation with both dual configs updated and no functional issues found. Changes are straightforward, consistent between the two config files, and technically correct. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant Git as Git
participant prek as prek hooks
participant UV as uv
Dev->>Git: git rebase / git commit --amend
Git-->>prek: post-rewrite (fires after rewrite)
prek->>UV: uv sync
UV-->>Dev: venv updated, uv.lock fresh
Dev->>Git: git checkout / git pull (merge)
Git-->>prek: post-checkout / post-merge
prek->>UV: uv sync
UV-->>Dev: venv updated, uv.lock fresh
Dev->>Git: git commit (pre-commit stage)
Git-->>prek: pre-commit
prek->>UV: uv lock (lock file check)
UV-->>Dev: uv.lock updated if pyproject.toml changed
Reviews (1): Last reviewed commit: "fix: add post-rebase uv-sync hook to pre..." | Re-trigger Greptile |
Closes DOT-471
Summary
uv-synchook onpost-checkout,post-merge, andpost-rewritestages to bothprek.tomland the generated template (project/prek.toml.jinja)post-checkout,post-merge,post-rewritetodefault_install_hook_typesso prek wires up the git hook shimsProblem
When a stacked branch is restacked onto a base that changed
pyproject.toml(e.g. version bump),uv.lockbecomes stale. Theuv-lockpre-commit hook only fires whenpyproject.tomloruv.lockare in the changeset — so after rebase it skips and CI fails with a version mismatch.Note
Users of the template need to re-run
prek installafter pulling this change to register the new git hook stages.