News for hackers. Stuff that matters.
Re:Pre-commit hooks are fundamentally broken by lemonlime227 on Saturday December 27, 2025 @04:22AM (#46400428)
To bring up jujutsu, `jj fix` (https://docs.jj-vcs.dev/latest/cli-reference/#jj-fix) is a more refined way of ensuring formatting in commits. It runs a formatting command with the diff in stdin and uses the results printed to stdout. It can simplify merges and rebases history to ensure all your commits remain formatted (so if you enable a new formatting option, it can remove the need for a special format/style fix commit in your mutable set). Hard to go back to pre-commit hooks after using jj fix (also hard to use git after using jj ;) ).
Re:Pre-commit hooks are fundamentally broken by conradludgate on Saturday December 27, 2025 @04:33AM (#46400493)
The downside currently (although I've been assured this will be fixed one day) is that it doesn't support running static analysis over each commit you want to fix.

My git rebase workflow often involves running `git rebase -x "cargo clippy -- --deny=warnings"`. This needs a full checkout to work and not just a single file input

Re:Pre-commit hooks are fundamentally broken by lemonlime227 on Saturday December 27, 2025 @08:35AM (#46401753)
Yeah, to add some context for people reading this, jj fix works best for edits local to the diff, and it’s meant for edits mostly. With some trickery you could run some analysis, but it’s not what jj fix is meant for right now.

The intended future solution is `jj run` (https://docs.jj-vcs.dev/latest/design/run/), which applies similar ideas to more general commands.

Re:Pre-commit hooks are fundamentally broken by andrewaylett on Saturday December 27, 2025 @01:46PM (#46404111)
I keep a couple of jj aliases that apply the `pre-commit` tool to a commit or a tree of commits:

https://github.com/andrewaylett/dotfiles/blob/7a79cf166d1e7b...

What I really want is some way within jj to keep track of which commits have been checked and which are currently failing, so I can template it into log lines.

Re:Pre-commit hooks are fundamentally broken by dbt00 on Saturday December 27, 2025 @04:28AM (#46400465)
Came here to mention jj fix. It is a fundamentally more elegant way of doing things.