-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
a22255b
commit 48580ed
Showing
13 changed files
with
195 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,7 @@ remote | |
Log all remote branches, which you authored or committed to | ||
`jj log -r 'remote_branches() & (committer([email protected]) | author([email protected]))'` | ||
Log all descendants of the current working copy, which aren't on a remote | ||
`jj log -r ':@ & ~remote_branches()'` | ||
`jj log -r '::@ & ~remote_branches()'` | ||
|
||
## Merge conflicts | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,7 +159,7 @@ called the "root commit". It's the root commit of every repo. The `root` symbol | |
in the revset matches it. | ||
There are also operators for getting the parents (`foo-`), children (`foo+`), | ||
ancestors (`:foo`), descendants (`foo:`), DAG range (`foo:bar`, like | ||
ancestors (`::foo`), descendants (`foo::`), DAG range (`foo::bar`, like | ||
`git log --ancestry-path`), range (`foo..bar`, same as Git's). There are also a | ||
few more functions, such as `heads(<set>)`, which filters out revisions in the | ||
input set if they're ancestors of other revisions in the set. | ||
|
@@ -345,7 +345,7 @@ $ jj new -m ABC; printf 'A\nB\nc\n' > file | |
Working copy now at: 6f30cd1fb351 ABC | ||
$ jj new -m ABCD; printf 'A\nB\nC\nD\n' > file | ||
Working copy now at: a67491542e10 ABCD | ||
$ jj log -r master:@ | ||
$ jj log -r master::@ | ||
@ mrxqplykzpkw [email protected] 2023-02-12 19:38:21.000 -08:00 b98c607bf87f | ||
│ ABCD | ||
◉ kwtuwqnmqyqp [email protected] 2023-02-12 19:38:12.000 -08:00 30aecc0871ea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.