Commit graph

6416 commits

Author SHA1 Message Date
Yuya Nishihara
b52b0646c2 cli: branch: restore is_fast_forward() function
This basically backs out 8706fadca1 "cli: inline check for
non-fast-forwardable branch move." I'm going to add another subcommand that
moves existing branches.
2024-06-18 12:48:32 +09:00
Martin von Zweigbergk
3b447703e5 github: run CI on push, not only on PRs
By running CI on push to any branch, collaborators can check that CI
passes before sending for review, reducing mail spam and wasted
reviewer time before the code is ready.
2024-06-18 11:29:04 +09:00
Yuya Nishihara
4ab1fc9bfe cli: file: sort subcommands chronologically
Otherwise they wouldn't be sorted in help. I also reordered the match statement.
Since subcommands are split to per-file modules, there's no point to keep some
logical ordering.
2024-06-18 10:45:06 +09:00
Martin von Zweigbergk
a861baecbf changelog: remove mention of jj file cat/ls aliases
These two aliases didn't survive code review.
2024-06-18 10:24:54 +09:00
tp-woven
1cf53a25f4 Update CHANGELOG.md
Fix config flag name in changelog.
2024-06-18 09:51:49 +09:00
dependabot[bot]
599c2da37b build(deps-dev): bump urllib3 from 2.2.1 to 2.2.2
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 09:47:56 +09:00
Yuya Nishihara
8e5671975c ui: remove Option<_> wrapping from ui.hint_() helpers
It's cumbersome to unwrap the Option just to print a short hint message. Let's
send the message to null output instead.
2024-06-18 09:37:23 +09:00
Yuya Nishihara
a162e4f1a4 cli: don't reuse ui.hint_default() instance to print multiple hints
ui.hint_*() calls will be inlined by the next commit.
2024-06-18 09:37:23 +09:00
Yuya Nishihara
1ab0c91e51 cli: inline labeling of trackable remote branches hints
This makes it clear that these hints are printed only if status output is
enabled.
2024-06-18 09:37:23 +09:00
Yuya Nishihara
b9e29b009d formatter: add .labeled().with_heading() helper
I'm going to add a few callers of .with_heading() outside of ui.rs.
2024-06-18 09:37:23 +09:00
Yuya Nishihara
57022d6f04 ui: replace qualified std::io path
The "io" module is imported.
2024-06-18 09:37:23 +09:00
Matt Kulukundis
5d307e628b cli: create jj file list and deprecate jj files 2024-06-17 14:13:36 -04:00
Philip Metzger
30f54862dd docs: Add a page for community built tools.
Thank you all for building tools around it.
2024-06-17 19:47:13 +02:00
Matt Kulukundis
47bd6f4aa4 feat: Create a file command containing print and chmod
- rearrange the files involved to be more clear about structure
- deprecate existing `jj cat` and `jj chmod`
2024-06-17 12:17:49 -04:00
Yuya Nishihara
2de73f57fc conflicts: remove redundant information from ReadFile error
The ReadFile error message already says "when reading file content for file
{path}..".
2024-06-17 15:36:06 +09:00
Martin von Zweigbergk
f8a5ad0c7a conflicts: propagate error from conflict materialization 2024-06-17 14:33:29 +09:00
Martin von Zweigbergk
66e45a7a17 conflicts: inline materialize()
The function has no callers outside the module anymore (probably since
`MaterializeTreeValue` but I haven't checked). Inlining it will help
keep error handling simple in the next commit. Otherwise we'd need to
have it return an error type wrapping both `BackendError` and
`io::Error`.
2024-06-17 14:33:29 +09:00
Martin von Zweigbergk
ca1f19736c working_copy: drop "Internal backend error" message from error
I don't think the message adds anything over what the `BackendError`
itself provides, so let's use `transparent` instead.

I also dropped the `Internal` prefix from the variant because that
also didn't seem to add anything.
2024-06-17 14:33:29 +09:00
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