mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-20 03:20:08 +00:00
docs: update immutable_heads()
examples to use builtin_immutable_heads()
Users should generally use `builtin_immutable_heads()` when they override `immutable_heads()`, so this patch updates the existing example to use that. I also added another example showing how to make an additional remote-tracking bookmark immutable.
This commit is contained in:
parent
4c25f3475d
commit
9e80d0c51d
1 changed files with 11 additions and 4 deletions
|
@ -266,13 +266,20 @@ diff-invocation-mode = "file-by-file"
|
||||||
|
|
||||||
You can configure the set of immutable commits via
|
You can configure the set of immutable commits via
|
||||||
`revset-aliases."immutable_heads()"`. The default set of immutable heads is
|
`revset-aliases."immutable_heads()"`. The default set of immutable heads is
|
||||||
|
`builtin_immutable_heads()`, which in turn is defined as
|
||||||
`present(trunk()) | tags() | untracked_remote_bookmarks()`. For example, to
|
`present(trunk()) | tags() | untracked_remote_bookmarks()`. For example, to
|
||||||
prevent rewriting commits on `main@origin` and commits authored by other users:
|
also consider the `maint@origin` bookmark immutable:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# The `main.. &` bit is an optimization to scan for non-`mine()` commits only
|
revset-aliases."immutable_heads()" = "builtin_immutable_heads() | maint@origin"
|
||||||
# among commits that are not in `main`.
|
```
|
||||||
revset-aliases."immutable_heads()" = "main@origin | (main@origin.. & ~mine())"
|
|
||||||
|
To prevent rewriting commits authored by other users:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# The `trunk().. &` bit is an optimization to scan for non-`mine()` commits
|
||||||
|
# only among commits that are not in `trunk()`.
|
||||||
|
revset-aliases."immutable_heads()" = "builtin_immutable_heads() | (trunk().. & ~mine())"
|
||||||
```
|
```
|
||||||
|
|
||||||
Ancestors of the configured set are also immutable. The root commit is always
|
Ancestors of the configured set are also immutable. The root commit is always
|
||||||
|
|
Loading…
Reference in a new issue