Commit graph

6295 commits

Author SHA1 Message Date
Yuya Nishihara
186f639dfb docs: sort list of operators in order of binding strengths
We can add a separate precedence/associativity table, but I think the ordered
list is good enough. Nullary :: and .. have no binding, but inserted after the
infix versions for brevity.
2024-06-07 11:27:37 +09:00
dploch
539edad216 diff_util: don't panic for file hashes < 10 hex chars 2024-06-06 11:50:59 -04:00
Martin von Zweigbergk
9fb5307b78 changelog: sort names in 0.18 release notes 2024-06-06 19:46:55 +09:00
Théo Daron
db8f655fe5 changelog: fix @tdaron username 2024-06-06 10:30:08 +02:00
mlcui
f2da2074cc changelog: Fix @mlcui-corp username
I have renamed myself from @mlcui-google to @mlcui-corp, but the
changelog still had the old username.

(That username is now taken by a squatter...)
2024-06-06 14:11:14 +10:00
Austin Seipp
33ac9bca6c release: version 0.18.0 2024-06-05 18:09:20 -05:00
Michael Gattozzi
3bc361a8b9 cli: add --allow-empty-description flag to push
This commit adds an optional flag to be able to push commits with an
empty description to a remote git repo. While the default behavior is
ideal we might need to interact with a repo that has an empty commit
description in it. I ran into this issue a few weeks ago pushing commits
from an open source repo to an empty repo and had to go back to using
git for that push as I would not want to rewrite the history which was
many many years long just for that.

This flag allows users an escape hatch for pushing empty descriptions
for commits and they're sure that they want that behavior.

This commit adds the flag to the `git push` command and updates the docs
for the command. It also updates the original test to make sure that the
flag works as intended to reject the commit when not set and to allow
the commit when the flag is set.

Closes #2633
2024-06-05 14:58:36 -04:00
Benjamin Tan
a3c6a9b1b7 new: allow --insert-before and --insert-after simultaneously 2024-06-05 19:29:27 +08:00
Benjamin Tan
bbadc6f14f new: extract out ensure_no_commit_loop function 2024-06-05 19:29:27 +08:00
Benjamin Tan
256a51f835 new: convert --insert-before and --insert-after into proper options 2024-06-05 19:29:27 +08:00
Benjamin Tan
f74618f41d new: refactor creation of new commit into common code path 2024-06-05 19:29:27 +08:00
Benjamin Tan
a45a505b66 new: avoid manual unwrap() call 2024-06-05 19:29:27 +08:00
dependabot[bot]
ccf25a5d56 cargo: bump unicode-width in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [unicode-width](https://github.com/unicode-rs/unicode-width).


Updates `unicode-width` from 0.1.12 to 0.1.13
- [Commits](https://github.com/unicode-rs/unicode-width/compare/v0.1.12...v0.1.13)

---
updated-dependencies:
- dependency-name: unicode-width
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 10:41:30 +09:00
dependabot[bot]
9635f0a846 github: bump the github-dependencies group with 3 updates
Bumps the github-dependencies group with 3 updates: [DeterminateSystems/nix-installer-action](https://github.com/determinatesystems/nix-installer-action), [DeterminateSystems/magic-nix-cache-action](https://github.com/determinatesystems/magic-nix-cache-action) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `DeterminateSystems/nix-installer-action` from 11 to 12
- [Release notes](https://github.com/determinatesystems/nix-installer-action/releases)
- [Commits](8cdf194da9...7993355175)

Updates `DeterminateSystems/magic-nix-cache-action` from 6 to 7
- [Release notes](https://github.com/determinatesystems/magic-nix-cache-action/releases)
- [Commits](87e8236f46...b46e247b89)

Updates `github/codeql-action` from 3.25.7 to 3.25.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](f079b84933...2e230e8fe0)

---
updated-dependencies:
- dependency-name: DeterminateSystems/nix-installer-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
- dependency-name: DeterminateSystems/magic-nix-cache-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 10:41:03 +09:00
Yuya Nishihara
8745c01f98 revset: rename parse_expression_rule() to lower_expression()
As I said, revset has another symbol resolution stage. That's why this function
isn't called resolve_expression().
2024-06-05 10:39:32 +09:00
Yuya Nishihara
9f33d13dfd revset: replace ParseState with &RevsetParseContext
There's no longer a mutable state to be tracked.
2024-06-05 10:39:32 +09:00
Yuya Nishihara
cbffa17bf0 revset: move primitive typed expression helpers to parser module 2024-06-05 10:39:32 +09:00
Yuya Nishihara
e383d41d22 revset: rename typed expression helpers
This is the naming convention we use in templater. These helper functions no
longer requires the passed node is a function argument.
2024-06-05 10:39:32 +09:00
Yuya Nishihara
b281bcd5cb revset: inline invalid_arguments() constructor
There are only two callers, and this change might help if we want to extract
parse_function_call_node() to dsl_util.
2024-06-05 10:39:32 +09:00
Yuya Nishihara
14421ac126 revset: omit function name from type error messages
This simplifies the interface of helper functions. While revset doesn't have
top-level string pattern or integer literal, these parsing helpers could be
used to parse array subscript or n-th parent operator if any.
2024-06-05 10:39:32 +09:00
Yuya Nishihara
e9db051b84 cli: git: split loop that collects push directions and new targets
Just a minor code cleanup.
2024-06-05 10:39:17 +09:00
Danny Hooper
3050685ff3 cli: implement enough of jj fix to run a single tool on all files 2024-06-04 14:28:21 -05:00
Danny Hooper
bbd9ba31df lib: move command variable interpolation from merge tools to generic location 2024-06-04 14:28:21 -05:00
Danny Hooper
1ece76d128 cli: add a fake code formatter tool for testing 2024-06-04 14:28:21 -05:00
Martin von Zweigbergk
650eeb8935 cli: add jj fix proof of concept 2024-06-04 14:28:21 -05:00
Yuya Nishihara
fcc0b86f0a docs: fix another missing shell quoting around root()
We've turned the "root" symbol into a function before. That's probably why.
2024-06-04 21:19:16 +09:00
Matthew Davidson
88cb56d3dd docs: Fix zsh-breaking logging example 2024-06-04 20:44:11 +09:00
Yuya Nishihara
3a4258916c revset: inline parse_function_call_args()
The separate function looked rather verbose.
2024-06-04 09:56:21 +09:00
Yuya Nishihara
8a4abee87d revset: insert named "function" rules
This patch copies function rule processing from templater and fileset. Since
function and identifier rules are quite different, it's better to not rely on
the subtle difference between identifier and function_name tokens.
2024-06-04 09:56:21 +09:00
Yuya Nishihara
127e4d3455 revset: flatten symbol rule
This makes it clear that the identifier node is special. For the other
constructs, we don't distinguish between bare symbol and quoted string.
2024-06-04 09:56:21 +09:00
Yuya Nishihara
674d897352 revset: inline trivial parsing functions to eliminate obvious assertions 2024-06-04 09:56:21 +09:00
Ilya Grigoriev
441175f2f9 jj help git: Include "Git remotes" in the title
Previously, it sounded like `jj git` might only include highly-technical
commands, while IMO the most important commands in here are `jj git
fetch` and `jj git push`.
2024-06-03 09:36:06 -07:00
dependabot[bot]
0f12582818 cargo: bump proc-macro2 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [proc-macro2](https://github.com/dtolnay/proc-macro2).


Updates `proc-macro2` from 1.0.84 to 1.0.85
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.84...1.0.85)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 11:27:12 -05:00
Ilya Grigoriev
b1e5ca5348 cli git push: clearer user-facing messages
"Move forward" instead of "Move", "Move sideways" or "Move backward"
instead of (now misleading) "Force...".
2024-06-01 18:42:12 -07:00
Ilya Grigoriev
21b9453d59 jj help: note that move, checkout, and merge as deprecated 2024-06-01 18:38:23 -07:00
Ilya Grigoriev
ab195339b4 docs and jj help: hide deprecated jj move
Fixes #3807
2024-06-01 18:38:23 -07:00
Yuya Nishihara
2c9132adfc revset: remove RevsetExpression::StringPattern hack
It's no longer needed since we have proper AST tree now.
2024-06-02 10:28:54 +09:00
Yuya Nishihara
89ac3a1851 revset: split AST-level parsing and expression lowering stages
This will allows us to parse "file(..)" arguments as fileset expression by
transforming AST for example. I'm not sure if that's good or bad, but we'll
probably want to embed fileset expressions without quoting.

parse_expression_rule() is split to the first str->ExpressionNode stage and
the second ExpressionNode->RevsetExpression stage. The latter is called
"resolve_*()" in fileset, but we have another "symbol" resolution stage in
revset. So I choose "lower_*()" instead.
2024-06-02 10:28:54 +09:00
Yuya Nishihara
444e88e3b8 revset: backport AST types and helpers from templater and fileset
These types and helper functions will be enabled by the next patch.
2024-06-02 10:28:54 +09:00
Yuya Nishihara
2ea173185d revset: add expect_exact_arguments() helper, replace expect_one_argument()
Prepares for migration to dsl_util::FunctionCallNode.
2024-06-02 10:28:54 +09:00
Ilya Grigoriev
a30df323bd jj git push docs: document safety checks
As discussed in
https://discord.com/channels/968932220549103686/1226363798483636265/1226415448615288864
2024-06-01 11:19:48 -07:00
Yuya Nishihara
5e7cb3435e git: unset unborn HEAD ref on export
Otherwise, newly created default branch would be re-imported as a new Git HEAD.
This could be addressed by cmd_git_init(), but the same situation can be
crafted by using "git checkout -b".
2024-06-01 11:01:16 +09:00
Yuya Nishihara
00ae8603db tests: use get_log_output() helper in test_git_init.rs
It's copied from test_git_colocated.rs, and switched to commit_id.short()
because full-length commit_id looked too verbose. "all()" history isn't needed,
but it's easier to follow.
2024-06-01 11:01:16 +09:00
dependabot[bot]
4c57a8868f github: bump github/codeql-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.6 to 3.25.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9fdb3e4972...f079b84933)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-31 10:45:52 -05:00
dependabot[bot]
0fd616960f cargo: bump tokio from 1.37.0 to 1.38.0 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [tokio](https://github.com/tokio-rs/tokio).


Updates `tokio` from 1.37.0 to 1.38.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.37.0...tokio-1.38.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-31 10:45:36 -05:00
mlcui
458580cee2 working_copy: Add is_file_states_sorted to tree state proto
See #2651 and a935a4f70c for more
background.

This speeds up `jj log` in a large repo with watchman enabled by around
9%:

```
$ hyperfine --sort command --warmup 3 --runs 20 -L bin \
jj-before,jj-after "target/release/{bin} -R ~/chromiumjj/src log"
Benchmark 1: target/release/jj-before -R ~/chromiumjj/src log
  Time (mean ± σ):     788.3 ms ±   3.4 ms    [User: 618.6 ms, System: 168.8 ms]
  Range (min … max):   783.1 ms … 793.3 ms    20 runs

Benchmark 2: target/release/jj-after -R ~/chromiumjj/src log
  Time (mean ± σ):     713.4 ms ±   5.2 ms    [User: 536.1 ms, System: 176.2 ms]
  Range (min … max):   706.6 ms … 724.7 ms    20 runs

Relative speed comparison
        1.11 ±  0.01  target/release/jj-before -R ~/chromiumjj/src log
        1.00          target/release/jj-after -R ~/chromiumjj/src log
```
2024-05-31 22:28:35 +10:00
Martin von Zweigbergk
404f31cbc1 backend: add error variant for access denied, handle when diffing
Some backends, like the one we have at Google, can restrict access to
certain files. For such files, if they return a regular
`BackendError::ReadObject`, then that will terminate iteration in many
cases (e.g. when diffing or listing files). This patch adds a new
error variant for them to return instead, plus handling of such errors
in diff output and in the working copy.

In order to test the feature, I added a new commit backend that
returns the new `ReadAccessDenied` error when the caller tries to read
certain objects.
2024-05-30 18:27:38 -07:00
Martin von Zweigbergk
fccba76e8b cat: slightly change warning message about non-file paths
I'm going to add a similar message for access denied. That will want
an error message printed at the end. For consistency, let's do the
same for non-file paths.
2024-05-30 18:27:38 -07:00
Benjamin Tan
e0e123873b revset_graph: rename to graph and make generic over graph node type 2024-05-31 02:39:34 +08:00
Gregory Anders
f4bedf56f6 cli: clear line after writing
Clear the rest of the cursor line (from the cursor to the end of the
row) after drawing the progress bar rather than clearing the entire line
before drawing. This reduces flickering on terminal emulators which are
able to redraw rapidly.
2024-05-30 12:27:11 -05:00