Commit graph

939 commits

Author SHA1 Message Date
Martin von Zweigbergk
e8f91696fe style-guide: say that we prefer lower-level tests over e2e test
End-to-end tests using the `jj` binary are often easy and natural to
write, but it's easy to miss how much slower they are than `jj-lib`
tests.
2025-08-19 06:30:00 +00:00
Benjamin Tan
bb46ec23fe docs: update description of trunk() revset
This commit clarifies the order in which `trunk()` is resolved following
commit 5fedd36 (git init: prefer `upstream` over `origin` for `trunk()`
alias).
2025-08-18 13:28:32 +00:00
Remo Senekowitsch
6dc5d95e0d op: revert: fix missed string during rename from op undo
I only grepped for "undo", so "undid" slipped through the cracks.
2025-08-17 23:49:54 +00:00
George Christou
bb9882fba1 cli: op show: add templates.op_show configuration 2025-08-17 13:16:55 +00:00
George Christou
b89cce9162 template: add any and all methods to lists
This allows checking whether "any" or "all" elements in a list satisfy a given
predicate, similar to Python's native `any()` and `all()` functions, but
instead as list methods that take lambda predicates.

These new methods follow the same pattern as existing `filter` and `map`
operations, i.e. taking a lambda that receives each item and must return a
boolean.
2025-08-16 11:28:35 +00:00
Nigthknight
e6867a18b2 docs: add definition for remotes to glossary 2025-08-15 21:51:48 +00:00
Remo Senekowitsch
36ee36ce78 op: undo: rename to revert
This paves the way for the semantics of `jj undo` and `jj op revert` to
evolve independently. `jj op revert` is going to stay the low-level
command to apply the inverse of any operation. The new name is
consistent with `jj revert`, which applies the inverse of a commit.

`jj undo` on the other hand is planned to become a higher-level command,
which is more similar to, say, Ctrl+Z in typical GUI applications.
Running `jj undo` repeatedly will revert progressively older operations,
allowing the user to walk backwards in time. At the same time, `jj undo`
will lose the abilitly to revert arbitrary operations, to keep its
semantics simple and intuitive.

Related feature request "jj undo ergonomics":
https://github.com/jj-vcs/jj/issues/3700
2025-08-15 21:31:15 +00:00
Gaëtan Lehmann
d526a6f0fd template: add a hash function 2025-08-10 19:24:36 +00:00
Austin Seipp
afb1c1446d git: add git.colocate to colocate repos by default
Most users colocate all of their repositories or none of them. A config
option is more convenient in that situation.

There are also plans to make colocated repos the default. This change
paves the way to flip the default easily.

Closes #2507.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-08-08 07:08:46 +00:00
Ivan Petkov
fa649051bb docs: add a note about rustfmt configuration for Nix/direnv users
The flake/devShell is already configured to pull in a nightly version of
`rustfmt` which means running `rustfmt +nightly` will actually fail
(since we aren't pulling in `rustup`).
2025-08-07 15:13:21 +00:00
George Elliott-Hunter
35a0bd330a docs: Fix 7176, document colocating a repo in Windows 2025-08-06 04:49:38 +00:00
Stephen Jennings
3ad854f975 fix: add $root variable that can be used in commands
On Windows, spawning a child process finds the command relative to the
parent's working directory. If a command is specified as
`["path/inside/repo/tool.exe"]`, then tool won't be found if `jj fix` is
run from a subdirectory of the workspace.

There doesn't seem to be a good way to change this behavior, nor does it
seem easy to convert `program` into an absolute path because
`["tool.exe"]` could refer either to a file on the PATH or a file
committed at the root of the repository.

So, we add a new variable `$root` that can be used in this situation.
Workspace-relative tools on Windows should be defined using this
variable:

```toml
# Tools on the PATH
command = ["tool.exe"]

# Workspace-relative tools
command = ["$root/tool.exe"]
command = ["$root/nested/dir/tool.exe"]
```

On Unix, the command is found relative to the working directory of the
child process, so this isn't an issue.

Fixes #7144
2025-08-05 14:37:04 +00:00
Scott Taylor
9d8f351a09 docs: display optional arguments more simply
I was initially planning to try adding an `nth` keyword argument to
`parents()` instead of adding `first_parent()`, and I noticed that based
on the current style, it would have been shown as one of the following
in the revset documentation:

* `parents(x[, depth[, [nth=]index]])`
* `parents(x[, depth][, [nth=]index])`

These both seem difficult to read to me, so I'm proposing changing the
style to something more like this:

* `parents(x, [depth], [[nth=]index])`

I also added a brief section explaining the syntax in case it isn't
immediately obvious what the square brackets mean.
2025-08-04 23:56:38 +00:00
Stephen Jennings
5d732f4344 docs: Add guide for handling divergent changes 2025-08-04 18:59:02 +00:00
Yuya Nishihara
abd7f43507 templater: add commit.files() function to list existing files
I think this can be useful in CLI tests. I noticed there are lots of "jj file
list" calls in https://github.com/jj-vcs/jj/pull/6141 which could be combined
with "jj log" outputs.
2025-08-02 01:30:29 +00:00
Scott Taylor
760ca1525b revset: add first_parent() function
Resolves #4579.
2025-07-31 22:17:05 +00:00
phoebe
c9aa05de7b ssh-signing: add revocation-list option 2025-07-29 12:46:36 +00:00
Apromixately
0aaf57b14d docs: fix fork_point example 2025-07-29 02:11:52 +00:00
Scott Taylor
1f8aede388 revset: add first_ancestors() function 2025-07-28 22:16:04 +00:00
Pablo Brasero
585a7426f5 everything: ensure consistent spelling of "behavior" 2025-07-28 16:19:31 +00:00
Nigthknight
c7e669ae54 docs: document how revsets can be prioritized in the log
Issue: #7081
2025-07-28 13:48:13 +00:00
Nigthknight
06831d0778 docs: document how to allow pushing new bookmarks by default
Issue: #7081
2025-07-28 13:48:13 +00:00
Martin von Zweigbergk
94b99b2460 revset: add naive version of bisect() function
This adds a version of the `bisect()` revset that simply takes the
midpoint of the input set when iterated over. That's correct in linear
history and probably usually good enough in non-linear history too. We
can improve it later. I think it's valuable to have this building
block even in an imperfect state.
2025-07-27 13:31:26 +00:00
Martin von Zweigbergk
b032fe2159 tutorial: fix incorrect change id in output
Closes #7084
2025-07-26 23:43:04 +00:00
Yuya Nishihara
ed931996d0 fileset: switch to globset
Unlike string patterns, backslash-escape syntax isn't forcibly enabled. Fileset
globs are constructed from platform-native path inputs.
2025-07-25 08:22:35 +00:00
Yuya Nishihara
182daa1dfa str_util: switch to globset
Since we already have globset in transitive dependencies, this change helps
reduce the amount of dependencies. Another reason is that globset provides a
function to convert glob to regex. This is nice because we use globs to match
against strings or internal repository paths instead of platform-native paths.

The GlobPattern wrapper is boxed because globset::Glob type is relatively big.
2025-07-25 08:22:35 +00:00
Josh Steadmon
79939a3c62 docs: record orthros as a contributor whose employer pays for contributions 2025-07-24 04:53:13 +00:00
Daniel Luz
2c0a1331be annotate: add original line number to template
Fixes #6103.
2025-07-22 20:29:05 +00:00
Jake Martin
35590404cb docs: update the tutorial to fix a typo 2025-07-22 20:23:18 +00:00
Ori Avtalion
c69b55c39f docs: mention jj file track where snapshot.auto-track is described 2025-07-22 13:17:14 +00:00
Ori Avtalion
2ba52a433e docs: mention jj file track in FAQ about scratch files
It described how to disable auto-tracking, and didn't mention how to
track files.
2025-07-22 13:17:14 +00:00
Kaiyi Li
9d817b6491 config: move fsmonitor settings out of core 2025-07-21 03:38:34 +00:00
Martin von Zweigbergk
17ee58666d cargo: update MSRV to 1.85
Rust 1.85 lets us use async closure and switch to the 2024 edition.
2025-07-20 23:52:04 +00:00
Ilya Grigoriev
fedbc3017f cli merge tools: allow setting diff-args=[] to disable diff formatting with a tool
Not setting `diff-args` is equivalent to `diff-args=["$left",
"$right"]`, which I also documented here.

I couldn't decide whether the new error should be part of
`DiffRenderError`, `DiffGenerateError`, or `MergeToolError`. Since the
treatment of diff formatters is already very different from other merge
tools, I just made it a CommandError for now.
2025-07-19 03:39:16 +00:00
Ilya Grigoriev
dae9ce7677 cli merge tools: allow setting edit-args=[] to disable diff editing with a tool 2025-07-19 03:39:16 +00:00
Ilya Grigoriev
2a221b0f8e docs config.md: explain unspecified merge-args/diff-args for a tool 2025-07-19 03:39:16 +00:00
Josh Steadmon
d7fa04f510 templater: add parents() method for Operation
Add a parents() method for `Operation` template objects, copied from the
implementation for `Commit`s.

The test case added in test_operations.rs was heavily inspired by
test_commit_templates.rs:test_log_parents().

Fixes #6979
2025-07-18 17:16:09 +00:00
Philip Metzger
24e565c8de website: Add the CHANGELOG
This was requested by @lilyball on Discord. I still think we should create a blog longterm
so we can announce stuff and run surveys, but this small step won't block it.
2025-07-17 22:59:58 +00:00
Kaiyi Li
f1f1556731 local working copy: add support for EOL conversion 2025-07-17 15:36:28 +00:00
Martin von Zweigbergk
3b32b88e6c docs: explain how e.g. the commit_id() revset can override a bookmark 2025-07-17 06:16:31 +00:00
Tyarel8
36133ced77 docs: add scoop to windows installation 2025-07-16 20:34:53 +00:00
Yuya Nishihara
ea3c1791a6 revset: soft-deprecate "all:" modifier syntax 2025-07-11 17:15:26 +00:00
Yuya Nishihara
6c8f6e9744 cli: allow "large" revsets by default
Since divergent/conflicted symbols no longer resolve to multiple revisions, it's
less scary to allow "large" revsets than before.

The config doc is removed because it's largely duplicated from the revsets doc,
and the config key will be removed.

#6016
2025-07-11 17:15:26 +00:00
Martin von Zweigbergk
51d7738112 code-of-conduct: replace @avamsi by @icorbrey as Community Leader
As we've discussed on Discord, the community would prefer the
community leaders to be people who are actively involved in the
community. Vamsi hasn't been involved lately, and Isaac has offered to
take on the role. Thanks, both!
2025-07-11 17:14:07 +00:00
Martin von Zweigbergk
d4d9881563 docs: jj diff -r is no longer an example of single-revision command 2025-07-11 17:10:00 +00:00
Martin von Zweigbergk
6485049676 docs: include another example of .. vs :: difference
We still get many questions about the difference between `..` and
`::`. It turns out we didn't have an example of the typical case of
using `..` to find commits on a feature branch compared to the main
branch. This patch adds such an example.
2025-07-10 05:58:26 +00:00
Alexander Kobjolke
d858d8cb41 docs: document Commit.signature() 2025-07-08 00:47:52 +00:00
Pavan Kumar Sunkara
c038ef4bc3 workspaces: Add templating support to workspace list 2025-07-07 19:14:07 +00:00
Yuya Nishihara
be094ef76e revset: don't resolve symbol expression to multiple revisions
It's surprising that a symbol expression may be resolved to multiple revisions,
and that's one of the reason we require all: modifier in some places. Let's make
a symbol resolution fail in that case so we can deprecate the all: syntax.

The new error hints are a bit less informative, but I don't want to implement
ad-hoc formatting for resolve_some_revsets_default_single(). The user will have
to review the graph anyway in order to resolve divergence/conflicts.

Closes #5632
2025-07-07 14:11:29 +00:00
Jan Klass
344aa91df6 docs: Add GitButler to related-work 2025-07-06 12:51:44 +00:00