jj/docs
Martin von Zweigbergk a6ef3f0b6c cli: make set of immutable commits configurable
This adds a new `revset-aliases.immutable_heads()s` config for
defining the set of immutable commits. The set is defined as the
configured revset, as well as its ancestors, and the root commit
commit (even if the configured set is empty).

This patch also adds enforcement of the config where we already had
checks preventing rewrite of the root commit. The working-copy commit
is implicitly assumed to be writable in most cases. Specifically, we
won't prevent amending the working copy even if the user includes it
in the config but we do prevent `jj edit @` in that case. That seems
good enough to me. Maybe we should emit a warning when the working
copy is in the set of immutable commits.

Maybe we should add support for something more like [Mercurial's
phases](https://wiki.mercurial-scm.org/Phases), which is propagated on
push and pull. There's already some affordance for that in the view
object's `public_heads` field. However, this is simpler, especially
since we can't propagate the phase to Git remotes, and seems like a
good start. Also, it lets you say that commits authored by other users
are immutable, for example.

For now, the functionality is in the CLI library. I'm not sure if we
want to move it into the library crate. I'm leaning towards letting
library users do whatever they want without being restricted by
immutable commits. I do think we should move the functionality into a
future `ui-lib` or `ui-util` crate. That crate would have most of the
functionality in the current `cli_util` module (but in a
non-CLI-specific form).
2023-09-25 15:41:45 -07:00
..
design docs/design: Clarify run.md a bit. 2023-09-14 16:39:40 +02:00
technical docs: More info about syncing jj repo with rsync 2023-09-06 09:15:27 -07:00
branches.md templater: indicate if branch needs to be pushed to a remote 2022-11-09 22:44:55 -08:00
code-of-conduct.md
config.md cli: make set of immutable commits configurable 2023-09-25 15:41:45 -07:00
config.toml configs: use Notepad as default editor on Windows 2023-08-10 17:09:07 +00:00
conflicts.md docs: indent conflict marker examples to not confuse tools 2022-12-12 16:20:40 -08:00
contributing.md docs: add a section about profiling 2023-09-14 21:15:03 -07:00
FAQ.md faq: add entry about accidentally amended working copy 2023-09-08 08:59:59 -07:00
git-comparison.md Small addition to index comparison 2023-08-14 13:48:46 +09:00
git-compatibility.md docs: mention git pack-refs for co-located repos 2023-09-15 19:49:11 -07:00
github.md docs: prefer new revset operator :: over deprecated : 2023-09-06 13:09:14 -07:00
glossary.md revset: convert root symbol to function 2023-09-04 10:36:30 +09:00
install-and-setup.md install-and-setup.md: explain how to compile the latest release 2023-09-11 18:21:56 -07:00
operation-log.md docs: fix typo in operation-log.md 2023-08-13 05:08:45 +00:00
related-work.md docs: add doc comparing jj to Sapling (#1708) 2023-06-28 06:56:57 +02:00
revsets.md cli: add upstream remote to default trunk() 2023-09-19 20:51:23 -07:00
sapling-comparison.md docs: markdown fixups, mostly to remove links pointing outside docs 2023-08-28 10:43:48 -07:00
templates.md templates.md docs: Document string literal format 2023-09-15 20:16:09 -07:00
tutorial.md docs: prefer new revset operator :: over deprecated : 2023-09-06 13:09:14 -07:00
working-copy.md workspace: add a root subcommand to print the workspace root path 2023-01-24 16:53:54 +01:00