ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/docs
Martin von Zweigbergk 48580ed8b1 revsets: allow :: as synonym for :
The `--allow-large-revsets` flag we have on `jj rebase` and `jj new`
allows the user to do e.g. `jj rebase --allow-large-revsets -b
main.. -d main` to rebase all commits that are not in main onto
main. The reason we don't allow these revsets to resolve to multiple
commits by default is that we think users might specify multiple
commits by mistake. That's probably not much of a problem with `jj
rebase -b` (maybe we should always allow that to resolve to multiple
commits), but the user might want to know if `jj rebase -d @-`
resolves to multiple commits.

One problem with having a flag to allow multiple commits is that it
needs to be added to every command where we want to allow multiple
commits but default to one. Also, it should probably apply to each
revset argument those commands take. For example, even if the user
meant `-b main..` to resolve to multiple commits, they might not have
meant `-d main` to resolve to multiple commits (which it will in case
of a conflicted branch), so we might want separate
`--allow-large-revsets-in-destination` and
`--allow-large-revsets-in-source`, which gets quite cumbersome. It
seems better to have some syntax in the individual revsets for saying
that multiple commits are allowed.

One proposal I had was to use a `multiple()` revset function which
would have no effect in general but would be used as a marker if used
at the top level (e.g. `jj rebase -d 'multiple(@-)'`). After some
discussion on the PR adding that function (#1911), it seems that the
consensus is to instead use a prefix like `many:` or `all:`. That
avoids the problem with having a function that has no effect unless
it's used at the top level (`jj rebase -d 'multiple(x)|y'` would have
no effect).

Since we already have the `:` operator for DAG ranges, we need to
change it to make room for `many:`/`all:` syntax. This commit starts
that by allowing both `:` and `::`.

I have tried to update the documentation in this commit to either
mention both forms, or just the new and preferred `::` form. However,
it's useless to search for `:` in Rust code, so I'm sure I've missed
many instances. We'll have to address those as we notice them. I'll
let most tests use `:` until we deprecate it or delete it.
2023-07-28 22:30:40 -07:00
..
design docs/design: propose submodule storage approach 2023-04-24 14:29:47 -07:00
technical cargo: rename crates from jujutsu/jujutsu-lib to jj-cli/jj-lib 2023-07-09 06:40:43 +02: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 Boilerplate for new Google open source project 2020-12-11 23:37:59 -08:00
config.md revsets: allow :: as synonym for : 2023-07-28 22:30:40 -07:00
config.toml Update docs/config.toml with new way to show relative timestamps 2023-02-15 21:26:14 -08:00
conflicts.md docs: indent conflict marker examples to not confuse tools 2022-12-12 16:20:40 -08:00
contributing.md docs: fix contributing.md 2023-07-17 19:22:51 -05:00
git-comparison.md git-comparison: update git's "remove file" command 2023-07-11 15:42:45 +10:00
git-compatibility.md git.rs: properly abandon commits from moved/deleted branches on remote (#864) 2023-05-17 17:57:58 -07:00
github.md revsets: allow :: as synonym for : 2023-07-28 22:30:40 -07:00
glossary.md docs: add a glossary 2023-04-17 16:48:23 -07:00
operation-log.md operation-log.md: Give a brief description of @, +, - 2023-02-18 22:42:51 -08:00
related-work.md docs: add doc comparing jj to Sapling (#1708) 2023-06-28 06:56:57 +02:00
revsets.md revsets: allow :: as synonym for : 2023-07-28 22:30:40 -07:00
sapling-comparison.md docs: add doc comparing jj to Sapling (#1708) 2023-06-28 06:56:57 +02:00
templates.md docs: add a word to docs about divergent 2023-04-09 22:56:33 -07:00
tutorial.md revsets: allow :: as synonym for : 2023-07-28 22:30:40 -07:00
working-copy.md workspace: add a root subcommand to print the workspace root path 2023-01-24 16:53:54 +01:00