3 ms·
Jj treats any public/pushed commits/branches as immutable by default.
by nchmy 1y ago
Jj treats any public/pushed commits/branches as immutable by default.
- 1718627440 1y agoHow does it know that? Does it also work, when I clone or pull instead? Is that only enforced on the committer side? I mean git also doesn't force push by default, but that still means someone else can do that and I need to notice it.
- nchmy 1y agoI don't have answers for you. But the docs are useful and people in their discord are helpful as well
- stouset 1y agoThere is a way to express which sets of revisions are immutable. This uses the revset feature which itself a whole amazing thing that hasn’t come up in the conversation yet. This is a mechanism by which you can concisely express and refer to entire sets of commits in your repo history, and lots of commands can operate on multiple revisions as easily as they can operate on one. Just like git, it is only enforced by the tool itself on the client side. But it’s safer in practice because `git push -f` is a common habit when you’re working on a branch by yourself and it’s easy to fat-finger that in the wrong place. I have only ever had to use `jj --ignore-immutable` when explicitly doing repo surgery. If you want branches like `main` to be truly immutable, you need to enforce that at the repo.