Commit graph

932 commits

Author SHA1 Message Date
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
Jan Klass
5f399e7444 Drop defunct Sturdy from related-work
* HTTPS can't connect
* HTTP has cloudfront 403 error page - [as per web archive at least since 2023-10-18](https://web.archive.org/web/20231018153827/https://getsturdy.com/)
* Uncommented [issue ticket](https://github.com/sturdy-dev/sturdy/issues/1360) since 2024-02-18
2025-07-06 06:55:50 +00:00
Martin von Zweigbergk
a3c81ea3eb faq: fix various issues in the new "undo merge" entry
* Added an explanation for why reverting a merge often results in an
   empty commit.
 
 * `jj revert <merge>` requires `-r`.

 * Fixed backwards description of merge direction (compared to what
   the graph shows).

 * Minor copy editing.
2025-07-02 11:40:31 +00:00
raylu
0921975dcf docs: Add git log -G to git command table 2025-07-02 03:38:59 +00:00
Yuya Nishihara
3a8b83d1fc cli: git-push: make "change" bookmark names templated
Someone asked this on Discord, and it's useful if the bookmark name should
include e.g. issue number (which can be extracted from commit description.)
2025-07-02 01:55:59 +00:00
Philip Metzger
60ccf6770e FAQ: Answer on how to revert merge commits
This is idiosyncratic to new users coming from Git, since `jj revert <merge>` does not 
usually do what users want. Maybe a followup could be adding a
warning in `jj revert`.

The explanation is from a Discord message from Austin.
2025-07-01 12:24:33 +00:00
Yuya Nishihara
49fc8abe69 docs: document the purpose of Stringify template type 2025-07-01 00:30:22 +00:00
Yuya Nishihara
e3b6599424 templater: rename PlainText pseudo type to Stringify
Since the goal of this pseudo type is to get a String value, it can be called a
ToString or Stringify. I chose the latter because Stringify sounds similar to
Serialize (verb), and I don't want to rename the internal functions to
.try_into_to_string().

https://github.com/jj-vcs/jj/pull/6840#discussion_r2173076763
2025-07-01 00:30:22 +00:00