Replies: 2 comments 4 replies
-
There's no support for git hooks yet. Good point about updating the docs. I'll send a PR for that. Because the workflow in jj is quite different, some of the hooks don't seem to make much sense. For example, because we implicitly create commits from the working copy and/or without touching the working copy (e.g. when you change the description of an ancestor commit), Git's pre-commit hook would usually not make sense. I think even Git itself is considering skipping the pre-commit hook when rebasing, once they start doing it without touching the working copy. The post-commit doesn't make much sense either, since it also relies on HEAD being for the just-created commit. We could probably call the prepare-commit-msg hook. However, if the hook tries to inspect the working copy or Git's HEAD, it will typically not do what you want. Also, I just experimented a bit with it and the third "SHA1" argument it gets doesn't seem to actually be a SHA1 (it's been empty or the string "HEAD" in my experimentation). So maybe it only makes sense for jj to call it when the working copy is colocated with Git (i.e. created by Which hook(s) do you miss having support for? FWIW, I've planned to eventually add native (i.e. not Git-specific) hooks. There would be at least a transaction-level hook, which would let you inspect and approve the changes in a transaction (there's typically one transaction per command, plus maybe one more for snapshotting the working copy). |
Beta Was this translation helpful? Give feedback.
-
Echoing the support to add support to some of the git-hooks. The ones I use that I believe fit well with jj's workflow:
|
Beta Was this translation helpful? Give feedback.
-
Does
jj
have support for either git hooks or a similar mechanism?https://github.com/martinvonz/jj/blob/main/docs/git-compatibility.md doesn't seem to mention this one way or the other, so it'd be nice if it were discussed there even if the answer is no for now.
Beta Was this translation helpful? Give feedback.
All reactions