767 Commits

Author SHA1 Message Date
Ilya Grigoriev
345f7373e7 string patterns: make substr: an alias for substring: 2025-03-11 21:02:18 -07:00
Lucas Garron
4e22902249 Replace the PNG logo with a vector SVG version.
This version is significantly smaller and crisp at any resolution.

Update docs/index.md
2025-03-11 22:44:13 +00:00
Martin von Zweigbergk
fe846d69d4 faq: in entry about default jj log revset, explain rationale
The FAQ entry explaining why `jj log` doesn't show all commits
explained that the behavior is configurable but it didn't explain what
the rationale for not showing all commits is. Users coming from Git
are used to seeing all commits and probably read this FAQ entry to
find an answer. We don't want them to just update their config without
understanding why we have the default we have.
2025-03-11 17:55:32 +00:00
Yuya Nishihara
d37a5b1b74 fileset, revset: settle on optionally-quoted pattern syntax
Suppose revsets and filesets are primarily used in command shell, it would be
annoying if quoting is required in addition to the shell quoting. We might also
want to relax the revset parser to allow bare * in glob string.

Closes #2101
2025-03-11 08:35:27 +00:00
Martin von Zweigbergk
dc7216d73a cli: diff: support multiple revisions to -r 2025-03-11 06:27:51 +00:00
Ilya Grigoriev
bc06e66313 fileset docs: edits to quoting and file pattern instructions
- Swapped `file:"path"` and `cwd-file:"path"` for consistency with the first line

- Created a labeled section for quoting rules

- Elaborated on the quoting rules in the beginning of file pattern section.
2025-03-11 03:00:58 +00:00
Anton Älgmyr
a209f522ab docs: Update documentation wrt JJ_CONFIG and --when/--scope
This is hidden gem of a feature, especially in combination.

`JJ_CONFIG` being a directory allows loading multiple TOML config files.
`--when` can be used on the top level, which can lend itself to a much
cleaner config than `[[--scope]]` tables.
2025-03-08 11:19:39 +00:00
Brandon Hall
e71650a27a Update community_tools.md
Added a link and blurb about the took VS Code extension Jujutsu Kaizen
2025-03-07 01:13:25 +00:00
Martin von Zweigbergk
9aeb13488c docs: correct description of tracking of ignored files 2025-03-06 22:29:05 +00:00
George Christou
b7f7d923bd config: rename core.watchman.register_snapshot_trigger 2025-03-06 08:42:35 +00:00
Ilya Grigoriev
1ede79c483 MSRV: Update to 1.84 and run clippy --fix, cargo fmt
The CI seems to correctly use rustc 1.84.1 (and not 1.84.0) with this.

For reference, we last updated the MSRV to 1.76 in 5b517b5. According to
https://releases.rs/docs/1.76.0/, this was when it barely became stable.

`flake.nix` seems to be using a nightly toolchain now, so it seems there
is no need to update the version there.

The more precise clippy command used was:

cargo clippy --workspace --all-targets --fix
2025-03-06 07:24:28 +00:00
Ilya Grigoriev
2bcf0384e2 FAQ: detailed example for the "accidentally changed files in the wrong commit" question
It was requested on Discord once.

The result is almost a tutorial; we could consider actually moving it into the
tutorial and providing a link in the FAQ. That could be done separately.

The `jj` commands outputs are faked in a few, hopefully inconspicuous, ways.
Hopefully, this is not distracting.
2025-03-05 23:46:32 +00:00
Baltasar Dinis
61f3732ad8 docs: update the docs to best describe the authentication compatibility 2025-03-05 04:33:57 +00:00
Scott Taylor
a95281f9ca docs: fix syntax highlighting for conflicts.md
I think the `diff` syntax highlighting makes these examples harder to
read since it's inconsistent and wouldn't appear in real conflicts.
2025-03-03 22:42:14 +00:00
Burak Varlı
7b52ff51f0 cli git fetch: support string pattern syntax in remote option
Signed-off-by: Burak Varlı <unexge@gmail.com>
2025-03-01 12:11:19 +00:00
pylbrecht
f7ceac3bf4 unsign: implement jj unsign command
The output of `jj unsign` is based on that of `jj abandon`.

We output warnings when unsigning commits, which are not authored by the
user. This is encouraging to use `jj undo`, in case one unintentionally
drops signatures of others.

---

Co-authored-by: julienvincent <m@julienvincent.io>
Co-authored-by: necauqua <him@necauq.ua>
2025-02-25 13:36:44 +00:00
Anton Bulakh
76f79961fb sign: implement the jj sign command
We always sign commits. This means commits, which are already signed,
will be resigned. While this is cumbersome for people using hardware
devices for signatures, we cannot reliably check if a commit is already
signed at the moment (see https://github.com/jj-vcs/jj/issues/5786).

We output warnings when signing commits, which are not authored by the
user. This is encouraging to use `jj undo`, in case one unintentionally
signs commits of others.

The output of `jj sign` is based on that of `jj abandon`.

---

Co-authored-by: julienvincent <m@julienvincent.io>
Co-authored-by: necauqua <him@necauq.ua>
2025-02-25 13:36:44 +00:00
Bryce Berger
708e1c58cd cli: improve hint message when suggesting --ignore-immutable
There have been a number of users confused about why
their commits are immutable, or what to do about it, ex.
[https://github.com/jj-vcs/jj/discussions/5659].

Separately, I feel that the cli is too quick to suggest
`--ignore-immutable`, without context of the consequences. A new user
could see that the command is failing, see a helpful hint to make it not
fail, apply it and move on. This has wildly different consequences, from
`jj squash --into someone_elses_branch@origin` rewriting a single commit,
to `jj edit 'root()+'` rewriting your entire history.

This commit changes the immutable hint by doing the following:

* Adds a short description of what immutable commits are used for, and a
  link to the relevant docs, to the hint message.
* Shows the number of immutable commits that would be rewritten if
  the operation had succeeded.
* Removes the suggestion to use `--ignore-immutable`.
2025-02-23 02:24:43 +00:00
George Christou
e1abaca21c templater: add trim methods to String type 2025-02-21 21:23:11 +00:00
Andrew Gilbert
5dac0ef4d1 docs templates: add link to templates toml file 2025-02-17 21:02:23 +00:00
Alain Leufroy
fa3254b4a7 templates: add hook points for users to customize the default operation id
Same as `format_short_change_id`.

We can't use `format_short_id` because `operation.id()` does not have `shortest()` method.
2025-02-17 09:08:51 +00:00
maan2003
ec6f8278fd signing: allow specifying sign behavior 2025-02-16 05:56:52 +00:00
Yuya Nishihara
4ec22dde38 templater: port annotation line content to template
I originally thought we would have to add BString template type first, but we
can use opaque Template type instead.
2025-02-15 11:07:17 +00:00
Bryce Berger
3bc111e60e annotate: make AnnotationLine template type
Allows:
* self.commit()
* self.line_number()
* self.first_line_in_hunk()

Certain pagers (like `delta`), when used for `git blame`, only show the
commit information for the first line in a hunk. This would be a nice
addition to `jj file annotate`.

`jj file annotate` already uses a template to control the rendering of
commit information --- `templates.annotate_commit_summary`. Instead of
a custom CLI flag, the tools necessary to do this should be available in
the template language.

If `1 % 2` or `1.is_even()` was available in the template language, this
would also allow alternating colors (using `raw_escape_sequence`).

Example:

```toml
[templates]
# only show commit info for the first line of each hunk
annotate_commit_summary = '''
if(first_line_in_hunk,
  show_commit_info(commit),
  pad_end(20, " "),
)
'''
```
2025-02-15 02:34:38 +00:00
Yuya Nishihara
0d2becbac3 templater: add stringify(x) function to call string methods on template
It's also useful to remove color labels from the inner template.
2025-02-14 00:54:03 +00:00
Yuya Nishihara
78f08d9e6c docs: use single-quoted template string in JSON example
It's easier to parse than \".
2025-02-14 00:54:03 +00:00
Martin von Zweigbergk
5e694ea571 docs: record contributors whose employer pays for contributions
This adds a record of all contributing employees of companies who pay
for contributions. The purpose is to help make possible conflicts of
interest easier to spot. As far as we know, only Google currently pays
right now.
2025-02-13 21:52:02 +00:00
Ilya Grigoriev
d79c7a0dd5 mkdocs: update mkdocs-material and mkdocs-include-markdown-plugin
It's been about five months, and it seems best to occasionally try
updating. Let's see if this causes any problems.

There was also a minor breaking change to
`mkdocs-include-markdown-plugin`, I added an option to keep
the old behavior (which seems nice in this case).

To do these kinds of updates, `uv tree --outdated` is useful.
2025-02-13 17:30:21 +00:00
Matthew Davidson
204cffe386 Remove broken Sublime LSP TOML reference in config.md
Removes nonexistent Sublime TOML LSP server link. Since I wasn't able to find an alternative, I removed the Sublime bit entirely.
2025-02-13 04:44:39 +00:00
hkalbasi
272955f4fe templater: add .escape_json method to string 2025-02-12 22:17:30 +00:00
David Rieber
dd73b5ab7d bookmarks: First step to make target revision a required argument to bookmark create/move/set.
With this change a warning is shown if the user does not explicitly specify the target revision, but the behavior is unchanged (it still defaults to the working copy).
In the future the warning will be turned into an error. In other words, it will be required to specify target revision.

The bulk of the changes here are to prepare tests for the upcoming change, to make the transition easier.

For additional details please see:
* https://github.com/jj-vcs/jj/issues/5374
* https://github.com/jj-vcs/jj/discussions/5363
2025-02-11 22:21:19 +00:00
Emily
77f54a267e git: enable subprocessing by default
Given the previously‐stated intention of making this default
for the 0.27 release, prepare for that decision ahead of time by
enabling subprocessing by default on trunk. This will help surface
any regressions and workflow incompatibilities and therefore give
us more information to decide whether to keep or revert this commit,
without inconveniencing any users who haven’t already opted in to
the bleeding edge.

Please feel free to revert without hesitation if any major issues
arise; this is not intended as a strong commitment to enable this
option for the next stable release if it turns out to not be ready. In
that case, it’s better that we learn that early on in the cycle,
rather than having to revert at the last minute or, worse, cutting
a stable release that we later find contains a serious regression.
2025-02-10 22:10:22 +00:00
Austin Seipp
02500e5248 meta: add initial GOVERNANCE.md
This is the result of a lot of back and forth, the weekly efforts of the
governance working group, consisting of:

- Martin von Zweigbergk (martinvonz)
- Waleed Khan (arxanas)
- Emily Shaffer (nasamuffin)
- Austin Seipp (thoughtpolice; yours truly)

Many thanks as well to emeritus member Khionu Sybiern, who helped kickstart this
whole process.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-10 17:39:34 +00:00
Martin von Zweigbergk
d135e04f7d docs: undo another mistaken "branch->bookmark" change 2025-02-10 17:24:32 +00:00
Martin von Zweigbergk
1e25101cea
cli: status: replace "is clean" by "has no changes"
"The working copy has no changes" seems much easier to understand for
new users. Thanks to @Wilfred for the suggestion.
2025-02-10 08:01:50 -08:00
Martin von Zweigbergk
65dc6750e0 docs: move Git command table to a separate page
The table can be easy to miss in its current location.
2025-02-10 15:29:32 +00:00
Martin von Zweigbergk
ac55f52292 docs: swap "git" and "jj" columns in command equivalence table
The table is probably mostly used by users switching from Git, so it
makes sense to have the `git` command on the left side.
2025-02-10 15:29:32 +00:00
Martin von Zweigbergk
0cc1a17e78 faq: fix quoting of git.private-commits example
The example became incorrect when `jj config set` stopped promoting
values with apostrophes to strings in 3f115cb. Use a TOML literal
string to fix it.
2025-02-09 17:51:14 +00:00
Ilya Grigoriev
f543d24244 mkdocs: get rid of SITE_URL_FOR_MKDOCS
The bug that made it somewhat useful is hopefully fixed now. I
documented the issue in case it reappears.
2025-02-07 20:44:59 +00:00
Ilya Grigoriev
1d95bd6b55 docs and readme: add the new jj logo
It's half-sized (432x432 instead of 864x864) for size and
compressed with `pngquant` (difference not visible with
my eyes).
2025-02-07 20:40:23 +00:00
Ilya Grigoriev
2da0b73c22 favicon: make corners round, make birds a little larger
Also compressed with `pngquant` (I cannot notice the difference
before and after)

Followup to b3099b7
2025-02-07 20:40:12 +00:00
Josh Steadmon
975e1e1e24 templater: add optional ellipsis arg to truncate template functions
If an ellipsis arg is given to the truncate_* template functions, append (or
prepend) the ellipsis when the template content is truncated to fit the maximum
width.

Fixes #5085.
2025-02-06 11:34:33 -08:00
Yuya Nishihara
6f04f50a80 docs: add query example to fetch contributors from GitHub
I don't know if this is the correct way of using GitHub API, but it works.
2025-02-06 13:57:48 +00:00
Roman Timushev
6bd81c5800 docs: Add git merge to the git command equivalence table
People moving from git may want to know what is the jj equivalent of git merge.
2025-02-06 13:53:25 +00:00
Jonathan Gilchrist
9cd61ece4e docs: Split out commit guidelines into their own section
The commit guidelines feel like they're relevant before documentation
about the code review process - they could conceivably apply while
developing a change.

These often seem to get missed and raised during reviews - giving them
their own section may increase visibility.
2025-02-05 22:04:22 +00:00
Vincent Ging Ho Yim
8f15f7eae9 docs/install-and-setup: clarify wording re: binaries of latest GitHub release 2025-02-05 21:31:47 +00:00
Vincent Ging Ho Yim
0c12636981 docs/install-and-setup: move 'prerelease version' sentence to after 'Cargo Binstall' section
It seems that in 38daa9a the 'Cargo Binstall' section should have been inserted above the 'prelease version' sentence instead.
2025-02-05 21:31:21 +00:00
Vincent Ging Ho Yim
539cd75f90 docs: use styled admonition blocks for warnings
This is consistent with the rest of the docs.
2025-02-05 23:09:02 +11:00
Martin von Zweigbergk
f67373368e docs: describe how to do a release 2025-02-04 22:05:24 -08:00
Ilya Grigoriev
b95628c398 built-in pager: document key bindings
I mostly focused on:

- keys for absolute beginners
- keys for features for which it's not obvious they
  *have* a key binding
2025-02-05 02:38:11 +00:00