Commit graph

6348 commits

Author SHA1 Message Date
Matt Kulukundis
8aa71f58f3 feat: add an option to monitor the filesystem asynchronously
- make an internal set of watchman extensions until the client api gets
  updates with triggers
- add a config option to enable using triggers in watchman

Co-authored-by: Waleed Khan <me@waleedkhan.name>
2024-06-16 23:24:22 -04:00
Martin von Zweigbergk
4d08c2cce8 docs: include examples for operators
There's been a lot of questions about the subtle differences between
`..` and `::`. I hope these examples will help with that.

We should also add examples to the revset functions (e.g. `heads()` is
not obvious how it works), but that can come later.
2024-06-17 12:23:46 +09:00
Martin von Zweigbergk
182cf6d5e2 docs: explain what .. etc are shorthand for
`..` is shorthand for `root()..visible_head()`, for example. We don't
seem to explain that anywhere. I hope mentioning that will help
readers understand the relationship between the shorthands and the
full `x..y`, and also to see the correspondence between `..` and `::`
(in how their default left and right operands are the same).
2024-06-17 12:23:46 +09:00
Ilya Grigoriev
ce0c53796c test_generate_cli_reference: fixup to 52c415e, remove mysterious comment
If I can't tell what this comment means, probably nobody else can
either.

I think it might be a copy-paste error from whatever docs I copied the
initial version of the config from.
2024-06-15 20:30:40 -07:00
Ilya Grigoriev
5cbe8d2499 test_generate_cli_reference: Fixup to 16ec185
That old commit made a piece of documentation obsolete, but
I didn't realize it at the time.
2024-06-15 20:30:40 -07:00
Ilya Grigoriev
4a63506e9f docs CLI Reference: make the warning in the beginning less scary
I am currently not aware of any severe differences between the generated
markdown and `jj help`, though this could change if we look over the
text carefully or if we start using `clap` features we weren't using
before.
2024-06-15 20:30:40 -07:00
Ilya Grigoriev
e0af9a0c2c docs CLI Reference: upgrade clap-markdown to 0.1.4
Fixes important bugs. 🎉
2024-06-15 20:30:40 -07:00
Ilya Grigoriev
71d832b878 Add Unicode-3.0 to allowed licenses
Without this, `cargo deny` fails after a `cargo update`
(https://github.com/martinvonz/jj/actions/runs/9531433728/job/26272377250?pr=3892
failed, but once it includes this commit, #3892 no longer has a `cargo
deny` failure. The windows failure is unrelated))
2024-06-15 16:48:43 -07:00
Martin von Zweigbergk
a9953b3fb0 cli: deprecate jj split --siblings in favor of jj split --parallel
This better matches `jj parallelize`.
2024-06-15 22:45:34 +09:00
Manuel Caldeira
72438fc9d2 cli: deprecate -l short alias for --limit in favour of -n
This better matches `git log` and affects `jj log`, `jj op log` and `jj obslog`
2024-06-15 14:14:29 +02:00
Yuya Nishihara
059fc26df1 revset: forward RevsetExpression::parents()/children() to inner functions 2024-06-15 10:14:55 +09:00
Benjamin Tan
7c9f28a96f merge_tools: simplify file conflicts before attempting to resolve 2024-06-15 06:05:06 +08:00
Benjamin Tan
17c8daacef test_resolve_command: accept filename in check_resolve_produces_input_file 2024-06-15 06:05:06 +08:00
Benjamin Tan
9d4ac81c27 print_conflicted_paths: simplify file conflicts before printing 2024-06-15 06:05:06 +08:00
Benjamin Tan
716ec37560 test_local_working_copy: add test for snapshotting of edited materialized simplified conflict 2024-06-15 06:05:06 +08:00
Benjamin Tan
9be33724dc conflicts: materialize simplified file conflicts 2024-06-15 06:05:06 +08:00
Benjamin Tan
7106f6fd49 conflicts: handle parsing of simplified conflicts 2024-06-15 06:05:06 +08:00
Benjamin Tan
0e472166f1 merge: add get_simplified_mapping and update_from_simplified methods 2024-06-15 06:05:06 +08:00
Benjamin Tan
f74991c2e1 tests: add tests showing that individual file conflicts are not simplified/deduplicated 2024-06-15 06:05:06 +08:00
Yuya Nishihara
a7bff04af8 revset, templater: implement arity-based alias overloading
Still alias function shadows builtin function (of any arity) by name. This
allows to detect argument error as such, but might be a bit inconvenient if
user wants to overload heads() for example. If needed, maybe we can add some
config/revset syntax to import builtin function to alias namespace.

The functions table is keyed by name, not by (name, arity) pair. That's mainly
because std collections require keys to be Borrow, and a pair of borrowed
values is incompatible with owned pair. Another reason is it makes easy to look
up overloads by name.

Alias overloading could also be achieved by adding default parameters, but that
will complicate the implementation a bit more, and can't prevent shadowing of
0-ary immutable_heads().

Closes #2966
2024-06-14 23:11:29 +09:00
Yuya Nishihara
d38c9e86e8 revset, templater: include parameter names in AliasId
I'm going to add arity-based alias overloading, and we'll need function
(name, arity) pair to identify it in alias expansion stack. The exact parameter
names aren't necessary, but they can be embedded in error messages.
2024-06-14 23:11:29 +09:00
Kyle J Strand
03a0921e12 give descendants a range arg 2024-06-13 18:54:57 -06:00
Danny Hooper
986630b270 cli fix: change default from -s @ to -s 'reachable(@, mutable())'
Most of the value of `jj fix` over a shell script is in formatting commits
other than `@`. `@::` often doesn't contain those other commits, so `-s @` is a
bad default.

We could get the same effect from `-s 'mutable() & ::@'`, but `reachable()` is
a bit more explicit and simple to read.

We could also base this on excluding `trunk()`, but that just seems like an
indirection for `mutable()` that might ignore the user's intent if they have
configured part of trunk to be mutable.
2024-06-13 17:08:24 -05:00
Danny Hooper
faf9a9d757 cli fix: add revsets.fix config for default revset to be fixed 2024-06-13 17:08:24 -05:00
Austin Seipp
3acf985ac0 nix: update nix-direnv 2.3.0 -> 3.0.5 2024-06-13 15:33:05 -05:00
Austin Seipp
1eac4812c8 nix: zstd-compressed debug sections in devShell
This cuts the size of a final debug binary in half (~250MiB -> 127MiB)
in my dev shell, and saves about 15% of total `target/` directory size
when a full build from scratch happens (2GiB -> 1.7GiB). Let's take an
easy free win.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-06-13 14:02:50 -05:00
Austin Seipp
ad34d10951 nix: parallel rustc frontend in devShell
Only active within `devShell`; the default `.#jujutsu` package is unaffected
by this change. This somewhat increases CPU utilization and has a marginal
improvement on my local compile times, but it's also nice if you have to
recompile from scratch too.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: I07ab28991843ca3723185569db5f38f2ed076875
2024-06-13 14:02:50 -05:00
Austin Seipp
749481e552 nix: use the latest rust-nightly toolchain instead of stable
This is a change that does affect the nix built package, and is tested as part
of the CI Matrix, so there is now an actively maintained (by me) nightly build
that can be checked for regressions.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: If9a134de7e1d496d47936259c59f73c4a62a341f
2024-06-13 14:02:50 -05:00
Austin Seipp
4878114ec9 nix: run nix flake update 2024-06-13 14:02:50 -05:00
dependabot[bot]
06a8bde79b github: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.6 to 4.1.7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9)

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

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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-13 13:01:47 -05:00
Jonathan Tan
4cca84515a In lib, make "testing" feature depend on "git"
If not, `cargo build --no-default-features --features testing` will fail.
2024-06-11 17:14:57 -07:00
Martin von Zweigbergk
0fd1969e8f lib: make git support optional via crate feature
I've wanted to make the Git support optional for a long time. However,
since everyone uses the Git backend (and we want to support it even in
the custom binary at Google), there hasn't been much practical reason
to make Git support optional.

Since we now use jj-lib on the server at Google, it does make sense to
have the server not include Git support. In addition to making the
server binary smaller, it would make it easier for us (jj team at
Googlle) to prove that our server is not affected by some libgit2 or
Gitoxide vulnerability. But to be honest, neither of those problems
have come up, so it's more of an excuse to make the Git support
optional at this point.

It turned out to be much simpler than I expected to make Git support
in the lib crate optional. We have done a pretty good job of keeping
Git-related logic separated there.

If we make Git support optional in the lib crate, it's going to make
it a bit harder to move logic from the CLI crate into the lib crate
(as we have planned to do). Maybe that's good, though, since it helps
remind us to keep Git-related logic separated.
2024-06-11 22:03:20 +09:00
Martin von Zweigbergk
bfa0573cab repo/workspace: drop support for old repo formats
It's been more than 6 months since we added support for dynamically
selecting the working copy implementation. This patch drops support
for selecting the default implementation of that and other stores.
2024-06-11 22:03:20 +09:00
Yuya Nishihara
556c7291c1 revset: migrate syntactic tests to AST-based
This will hopefully help remove PartialEq from RevsetExpression. Some assertions
are duplicated so that AST->RevsetExpression transformation is covered by tests.
2024-06-11 20:00:47 +09:00
Yuya Nishihara
538701429a revset: backport parsing test helpers from templater and fileset 2024-06-11 20:00:47 +09:00
Yuya Nishihara
53fa95d73e fileset, templater: in tests, make parse_normalized() unwrap result
It's unlikely that we'll use "normalized" result to compare Err variants.
2024-06-11 20:00:47 +09:00
Yuya Nishihara
e7e06b6f8c fileset: use parse_into_kind() to test parse errors
parse_normalized() will be changed to unwrap the result.
2024-06-11 20:00:47 +09:00
Ilya Grigoriev
2d0b715ad0 docs: update windows docs to mention minus, update minus docs
Quick fix to #3850.
2024-06-10 11:47:34 -07:00
dependabot[bot]
c71eb73047 cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [clap](https://github.com/clap-rs/clap), [clap_complete](https://github.com/clap-rs/clap) and [regex](https://github.com/rust-lang/regex).


Updates `clap` from 4.5.6 to 4.5.7
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.6...v4.5.7)

Updates `clap_complete` from 4.5.4 to 4.5.5
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.4...clap_complete-v4.5.5)

Updates `regex` from 1.10.4 to 1.10.5
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.4...1.10.5)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 13:07:17 -05:00
Martin von Zweigbergk
78cbb513d1 fix: add support for fixing only some paths 2024-06-10 21:51:06 +09:00
Simon Wollwage
3cd1fe4753 Show paths of config files when configurations contain errors
This addresses issue #3317, where as discussed we want to show the paths to
configuration files if they contain errors, to make it easier for the user to
locate them.
2024-06-10 10:14:36 +00:00
Martin von Zweigbergk
6a57fa969d diff-editor: pass reference to store into apply_diff_builtin()
It's cheap to copy an `Arc` and it's simpler to pass just a reference.
2024-06-10 13:19:37 +09:00
Ilya Grigoriev
b8d0cf31b8 docs install_and_setup: move Arch Linux after From Source
I am not sure how to order the other entries, but "From Source" seems to
me like the most important one.
2024-06-09 10:15:16 -07:00
Ilya Grigoriev
5d57cf1977 docs: disable main and nightly aliases for prerelease version
This is an alternative to https://github.com/martinvonz/jj/pull/3732. I
think it's pretty important to show the "latest" alias. I don't know a
way to not show any alias for "prerelease" in the version selector
without deleting all of them. 

I'll have to then separately delete the directories for the aliases on
the gh-pages branch, so that the URL does not resolve to outdated pages.

The downsides are: this will break https://martinvonz.github.io/jj/main/... and
(only recently created) https://martinvonz.github.io/jj/nightly/... links. We
won't have an always-on demo of how well aliases work for when and if we adjust
how aliases (including the all-important latest alias) work in the future.

However, expanding on #3732 (comment), mike is now randomly alternating between
"nightly" and "main" being the first alias of prerelease (it never promised that
the set of aliases would be ordered). So, the version selector keeps switching
in which version it shows. Previously, this only affected the prerelease docs,
but now it also affects https://martinvonz.github.io/jj/latest/.
2024-06-08 23:21:00 -07:00
Martin von Zweigbergk
65a988e3d2 merged_tree: make tree builder attempt to resolve conflicts
As we discovered in the `jj fix` tests,
`MergedTreeBuilder::write_tree()` doesn't try to resolve conflicts,
not even trivial ones. This patch fixes that.
2024-06-08 20:29:30 +09:00
Martin von Zweigbergk
2e6a0f9e96 merged_tree: make resolve() also simplify the result
This changes the documented behavior of `resolve()` since it was
previously documented to not change the arity unless all conflicts
were resolved.

I plan to use `resolve()` from `MergedTreeBuilder::write_tree()`.
2024-06-08 20:29:30 +09:00
Martin von Zweigbergk
776b2d981f merged_tree: make resolve() return a MergedTree
It seems like a method on `MergedTree` should return another
`MergedTree` when reasonable. I'm not sure why I made it return a
`Merge<Tree>` instead.
2024-06-08 20:29:30 +09:00
Martin von Zweigbergk
6ab9d7bdc7 merged_tree: make resolve() on legacy tree an error
The current implementation of `resolve()` on legacy trees just
pretended any conflicts were regular files. It's better to error
out. The function is only used in tests so far.
2024-06-08 20:29:30 +09:00
Yuya Nishihara
660a917aaa revset: remove deprecated "program" rule, rename "program_with_modifier" 2024-06-08 12:48:46 +09:00
Yuya Nishihara
eda7069aee revset: represent program modifier as AST node
The goal is to remove special case from parsing functions and provide slightly
better error message. I don't know if we'd want to use "all:" in aliases, but
there are no strong reasons to disable it.
2024-06-08 12:48:46 +09:00