← Back to context

Comment by andrewaylett

4 hours ago

Just because the hooks have the label "pre-commit" doesn't mean you have to run them before committing :).

I, too, want checks per change in jj -- but (in part because I need to work with people who are still using git) I need to still be able to use the same checks even if I'm not running them at the same point in the commit cycle.

So I have an alias, `jj pre-commit`, that I run when I want to validate my commits. And another, `jj pre-commit-branch`, that runs on a well-defined set of commits relative to @. They do use `pre-commit` internally, so I'm staying compatible with git users' use of the `pre-commit` tool.

What I can't yet do is run the checks in the background or store the check status in jj's data store. I do store the tree-ish of passing checks though, so it's really quick to re-run.

My agents gave to run pre-commit before calling a coding tag done. In this case, it's just a robust set of checks.