Commit graph

381 commits

Author SHA1 Message Date
Ilya Grigoriev
b2792e190b cli config list docs: explain config key format in templates
This also means that this field should not become a `List<String>`,
though it would make sense to create a new type for it (which could be
converted into `List<String>` in two different ways, with or without
quoting).
2025-12-23 03:27:58 +00:00
Vincent Ging Ho Yim
e9b280148e cli commit: wrap each flag in backticks in doc comment
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-12-22 08:30:56 +00:00
Scott Taylor
33ad38bfed templates: add "divergent" label to log for divergent changes
It would be good to include the word "divergent" in the log when a
change is divergent, since users are often unsure what's happening when
they see a divergent change, and giving them a term to search for would
be helpful. However, I don't think it looks good to put this label next
to the change ID itself if both are the same color, since it ends up
being hard to distinguish from the change offset at a glance. Also,
putting the label next to the change ID also messes up the alignment of
fields in the log. Therefore, I think it looks better to put the
"divergent" label at the end of the line.

Since divergence and hidden commits are similar, it makes sense for both
labels to be in the same place, so I also moved the hidden label to the
end for consistency.

One downside is that the labels are less obviously connected with the
change ID itself due to them being farther apart. I think this could be
fine, since they are still visually connected by being the same color.
2025-12-20 16:55:51 +00:00
Steve Klabnik
5dd63d691e docs: improve interdiff command documentation
Rewrite the `interdiff` help text to be clearer about what the command does.

Closes #7033
2025-12-20 00:03:02 +00:00
Steve Klabnik
e00d154c92 cli: document -r as alias for positional revision arguments
Several commands accept both positional arguments and a `-r` flag for
specifying revisions. The `-r` flag exists for consistency with other
commands, but was previously hidden from help output.

Instead of unhiding `-r` (which would clutter the Options section),
document the aliasing by adding `[aliases: -r]` to the positional
argument's help text. This makes the relationship discoverable while
keeping the help output clean.

Commands updated: abandon, describe, duplicate, edit, metaedit, new, show

Fixes #8104
2025-12-19 22:29:01 +00:00
Steve Klabnik
a59c2d2efe docs: elaborate on jj git push behavior
Add more detail about both the range of commits that will be pushed, as well as
it being a --force-with-lease.

Fixes #3672
2025-12-19 22:01:42 +00:00
Steve Klabnik
ba0e9a4946 docs: clarify behavior of selected vs remaining changes
The help text for `jj split` was confusing about what happens to
"selected" vs "remaining" changes, especially with the `-o/-A/-B` flags.

This change:
- Adds ASCII diagrams showing the commit graph transformations for
  default split, --parallel, and -o/-A/-B modes
- Clarifies that by default, selected changes stay in the original
  commit while remaining changes go to a new child
- Explains that with -o/-A/-B, selected changes are extracted to a
  new commit at the destination while remaining changes stay in place
- Improves the --message flag description to clarify it applies to
  the first commit (containing selected changes)
- Adds explanatory text to the -o, -A, and -B flag descriptions
2025-12-19 20:22:57 +00:00
Yuya Nishihara
5e22ae6bd9 cli: new: parse -r/-o option properly, merge with positional arguments
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Because the order of parents matters, we have to merge positional and -o
arguments in order of appearance.
2025-12-19 09:39:53 +00:00
Yuya Nishihara
be34efe22b cli: show: parse -r option properly
The default can no longer be set by clap because there may be "-r" argument.
2025-12-19 09:39:53 +00:00
Yuya Nishihara
e461f2401a cli: edit: parse -r option properly
This one is easy since there should be exactly one REVSET argument.
2025-12-19 09:39:53 +00:00
Martin von Zweigbergk
a9fc4e8905 cli: add a very basic jj file search (like git grep)
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This is lacking a lot but should be good as a starting point.
2025-12-18 06:31:37 +00:00
Scott Taylor
edc578c56b docs: update examples of divergence to include change offsets 2025-12-16 02:02:31 +00:00
Yuya Nishihara
b9317da0f8 cli: enable glob string matching globally
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
The goal of this change is to unify defaults of string patterns in revsets and
command arguments. Glob is a good default because it's largely the same as exact
matching, and we can easily express substring patterns with globs.

The hint for "jj git fetch -b<glob>" is deleted since exact:<glob> is now
required in order to trigger the error.

This patch also updates help of clone/fetch --branch patterns. Glob and operator
support in refspecs is limited.
2025-12-15 04:27:32 +00:00
Steve Klabnik
c969da4b55 docs: clarify what happens to unselected changes in jj commit
When using `--interactive` or path arguments, it wasn't clear from the
help text what happens to the changes that aren't selected. This adds
an explanation to the main command documentation and updates the flag
and argument descriptions to use "current commit" instead.

Fixes #6666
2025-12-15 04:00:05 +00:00
Yuya Nishihara
e921791574 cli: bookmark: add --remote argument to track/untrack, deprecate name@remote
These two are the last commands which don't support logical operators in string
patterns. The old <kind>:<name>@<remote> syntax had various problems including:

 1. substring patterns look weird (e.g. `substring:x@y` means `*x*@*y*`)
 2. cannot express "all but <name> for all remotes" (e.g. `(~gh-pages)@(*)`)

In addition to that, the revset parser doesn't support `<name>@<remote>`
prefixed by `<kind>:`.

This patch introduces separate --remote argument to address these problems. The
default is `glob:*` (or `~git`), so we wouldn't have to specify the remote in
many cases. One caveat is that `jj bookmark track` is not idempotent if there
are multiple remotes:

    # there are two remotes: origin and upstream,
    # and only foo@origin exists
    $ jj bookmark track foo
    # tracks foo@origin and creates new local bookmark foo
    $ jj bookmark track foo
    # tracks absent foo@upstream as we now have a local bookmark

This is wild. We might want to add a flag or a new command to track absent
remote bookmarks to push.

"Unmatched names" warnings are now emitted for bookmark and remote names
separately. To keep the implementation simple, the search space isn't restricted
by the other parameter. For example, "jj bookmark track foo --remote=bar" won't
show a warning if "foo" exists locally or in any remote.

Closes #4260
2025-12-13 01:32:49 +00:00
Steve Klabnik
e5e4805ef4 docs: Improve squash command description
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Add an explanation for why it's called "squash".

Fixes #7661
2025-12-10 23:07:53 +00:00
Lukas Krejci
c24c035041 cli,lib: add suport for the push URL in git remote add 2025-12-10 09:15:06 +00:00
Lukas Krejci
f434b9f11e cli,lib: add support for git remote set-url (--fetch|--push) 2025-12-10 09:15:06 +00:00
Shaoxuan (Max) Yuan
8eecb09ca8 squash: improve help doc for running jj squash with no options
The help doc for `jj squash` is not explicit about what happens if there are no
options supplied to the command. Improve the help doc to explain the said
situation.

Fixes: #8241
2025-12-08 23:58:33 +00:00
Steve Klabnik
7da170d53f docs: mention ?? means 'divergence'
While divergence is talked about in the documentation, few places actually
mention how divergent changes are displayed. I've added such notes to the help
out put of `jj log`, the glossary, and added an example to the guide we have on
divergence.

Fixes #6365
2025-12-08 21:09:51 +00:00
Martin von Zweigbergk
11f58fc3be cli: copy note about jj op show -p from absorb to fix
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-12-06 01:04:00 +00:00
edef
da9924c75f cli: default Gerrit --remote-branch is gerrit.default-remote-branch
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
gerrit.default-branch does not seem to be a real option.
2025-12-03 11:44:03 +00:00
Yuya Nishihara
d504ac9482 cli: warn only unmatched exact patterns of cloned bookmarks, use remote default
Since the specified patterns are no longer guaranteed to match at least one
remote branch, the default (remote) branch is taken into account if exact
patterns match nothing. I think this is better because `-b glob:*` is now
identical to the default.
2025-12-02 10:56:39 +00:00
Hubert Lefevre
b523980445 cli: fix: Add a detailed execution example
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Add a detailed example of what will `jj fix` do.
2025-12-01 08:57:35 +00:00
Hubert Lefevre
42a713b5e4 docs: Move jj fix configuration documentation to config.md
In order to write config settings of tools for jj fix, you needed
information that were split in the `jj fix --help` text and
`jj help -k config` (or the respective web-pages).

Move every bit of information that is important to know to write
`jj fix` configurations in the config page. This avoid to have to
maintain the information up-to-date in two places.

Organize the help text of `jj fix` with several chapters.
2025-12-01 08:57:35 +00:00
Hubert Lefevre
b6728ce059 cli: fix: Precise the patterns are filesets
It is not mentioned and if you are new to jj you would not know what
the syntax is. While pretty obvious once you heard about filesets.
2025-12-01 08:57:35 +00:00
George Christou
711484da7d log: add --count flag
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
Inspired by @indirect's talk at JJ Con (https://www.youtube.com/watch?v=ZnTNFIMjDwg)
2025-11-29 17:21:07 +00:00
QingyaoLin
f3a749fbff docs: update nushell completion
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-11-26 15:20:37 +00:00
Steve Klabnik
5b3aa51140 docs: jj-vcs.github.io -> jj-vcs.dev
As a follow-up to #8115, this moves all references in the codebase to use the new website.

I didn't update the older CHANGELOG entries because I figured they're intended
to be immutable.
2025-11-26 00:36:39 +00:00
ase
c598135f64 docs: clarify that squash -o/A/B creates a new commit 2025-11-22 22:24:24 +00:00
Remo Senekowitsch
244cbf7d45 cli git push: deprecate --allow-new
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-11-22 08:18:44 +00:00
Remo Senekowitsch
0bb55c6252 config: deprecate git.push-new-bookmarks 2025-11-22 07:09:29 +00:00
Björn Kautler
a76f2c4dac docs: fix markdown sublists for the produced web pages 2025-11-19 03:53:18 +00:00
Lucio Franco
d9f2772988 cli: add jj file track --include-ignored flag
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This adds support for tracking ignored and oversized files with `jj file track`.

Previously, `jj file track` would silently fail to track files that were ignored by
`.gitignore` or larger than `snapshot.max-new-file-size`. This commit introduces an
`--include-ignored` flag that allows users to explicitly track these files.

## Implementation

Added a `force_tracking_matcher` field to `SnapshotOptions` that overrides ignore rules
and size limits. When `--include-ignored` is specified, the file pattern matcher is
passed as `force_tracking_matcher`, allowing three checks in `FileSnapshotter` to bypass
their usual restrictions for directory ignores, file ignores, and file size limits.

## Tests

- `test_track_ignored_with_flag`: Verifies `.gitignore`d files can be tracked
- `test_track_large_file_with_flag`: Verifies oversized files can be tracked
- `test_track_ignored_directory`: Verifies ignored directories can be tracked recursively

# Checklist

If applicable:

- [ ] I have updated `CHANGELOG.md`
- [x] I have updated the documentation (`README.md`, `docs/`, `demos/`)
- [ ] I have updated the config schema (`cli/src/config-schema.json`)
- [x] I have added/updated tests to cover my changes
2025-11-14 03:14:37 +00:00
Luke Randall
34bda5e44c cli: describe: deprecate --edit in favour of --editor 2025-11-10 16:13:07 +00:00
Luke Randall
df09d2b860 cli: commit: add --editor flag 2025-11-10 16:13:07 +00:00
Luke Randall
2e1794cbf5 cli: squash: remove -E flag and clean up code
This also removes the superfluous already_edited logic, which was
obviated by changes to the logic in #7929.
2025-11-10 16:13:07 +00:00
Luke Randall
b433a54ecb cli: split: add --editor flag 2025-11-10 16:13:07 +00:00
Martin von Zweigbergk
32aee9dbdf cli: deprecate --destination/-d in favor of --onto/-o
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
As we have discussed many times on Discord and GitHub, `--destination`
is not a great name because `--insert-before` and `--insert-after` are
also destinations. The most popular alternative seems to be
`--onto`. We already use that term in descriptions in several places,
such as in the help text for `rebase -d` where we say "The revision(s)
to rebase onto". This patch therefore renames the `--destination` flag
to `--onto`.

The short name naturally becomes `-o`. That is perhaps a little
unfortunate because it's a common short name for `--output <file>`
arguments, but we don't use that anywhere so it seems fine.

Perhaps we should also rename `--source` (used by `rebase` and `fix`)
to something else. Perhaps the most obvious name is `--descendants`,
but the short form would be `-d`, which is of course already taken by
`--destination` in the case of `rebase`. Either way, I'm leaving that
rename for later. It would be good to do it before next release if we
are going to do it, though.

Closes #7941
2025-11-08 14:56:37 +00:00
Luke Randall
9cc1ed1fcd cli: squash: add --editor flag
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-11-07 10:51:11 +00:00
Martin von Zweigbergk
b409aa3189 colocation: rename from "colocated repo" to "colocated workspace"
Colocation is about sharing the working copy between jj and git. It's
less important where the repo is stored. I therefore think we should
not call it "colocated repo". I considered renaming it to "colocated
working copy" but that sounded awkward in many places because we often
talk about the whole workspace (repo + working copy), so "In colocated
workspaces with a very large number of branches or other refs" sounds
better than "In colocated working copies with a very large number of
branches or other refs".

Once we support colocate workspaces in non-main Git worktrees, I think
this rename will be even more relevant because then all those
workspaces share the same repo but only some of them may be colocated.
2025-11-03 16:53:26 +00:00
Martin von Zweigbergk
e96af181df cli: document that jj git import/export are not needed when colocated
Closes #7910
2025-10-30 20:21:05 +00:00
Peter Schilling
5597ea2b33 docs: use long-form flag names in command documentation
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
in clap, the visible_aliases, e.g. '[aliases: --after]' are shown at 
the very end, which makes it confusing if you're reading from top to
bottom.

aliases are currently omitted entirely from the man pages, making it
confusing to see undocumented aliases being used.
2025-10-30 16:28:31 +00:00
Ilya Grigoriev
c32b476645 docs: fix and improve colocation docs
Follows up on 7c0328f

Fixes #7776
2025-10-30 01:30:11 +00:00
Cole Helbling
d1d8048538 metaedit: replace --update-committer-timestamp with --force-rewrite
Some checks failed
binaries / Build binary artifacts (push) Has been cancelled
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
Just moments ago, I ran into a case where I wanted to change both the
author and committer of a change. I knew about the new `jj metaedit`
command, but until now that only gave me the ability to update the
author of my change, so the committer would remain the same. My only
other option was to reach for `jj desc ... --reset-author`, which has
a deprecation warning:

    Warning: `jj describe --reset-author` is deprecated; use `jj metaedit --update-author` instead

In spite of that warning, this had the desired effect: both the author
and committer were updated.

So I figured I'd help `metaedit` grow these flags so it can be a _true_
replacement for `jj desc --reset-author`.

---

The above all happened before I was kindly informed in Discord
(https://discord.com/channels/968932220549103686/1431315533164314674)
that `jj metaedit --update-committer-timestamp` should do what I was
hoping for, which I had initially disregarded and never tried because
the help text originally said:

    This updates the committer date to now, without modifying the committer.

However, after trying it out, I noticed it actually _did_ modify the
committer.

So, I set out to improve the situation by renaming the flag (so it's
not partially-wrong: it does update the committer timestamp, as well as
everything else about the committer) and improving the help text in the
various flags.

---

In no particular order, thanks to:

* obtuse, for informing me that the `--update-committer-timestamp`
flag does what I wanted in the first place
* gaetan, for pointing out that my way of thinking was not quite meshing
with how jj does things (every modification will update the committer)
* Martin, for the new flag name
2025-10-25 22:31:16 +00:00
Yuya Nishihara
3a10ca3824 cli: git colocation: sort subcommands lexicographically 2025-10-23 01:50:55 +00:00
Angel Ezquerra
3c98f9a7d3 git: add git colocation enable | disable | status commands (fixes #4624)
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
This new command lets you turn a non colocated git repo into a colocated repo or vice-versa (by using the `jj git colocation enable` and `jj git colocation disable` commands respectively).
These commands simply implement the instructions found in https://github.com/jj-vcs/jj/blob/main/docs/git-compatibility.md#converting-a-repo-into-a-co-located-repo

You can also call `jj git colocation status` to show the current colocation status and `jj colocation` to show a help message (with the list of sub-commands).
2025-10-22 06:39:23 +00:00
Owen Brooks
f88b0d8093 cli: git clone: add --branch option
When cloning with the branch option:
- Only the specified branch will be fetched
- The trunk alias is only set if the specified branch happens to be the default branch
- The clone fails if the branch does not exist in the remote
2025-10-19 05:14:11 +00:00
Yuya Nishihara
1f30c337c7 cli: add tag delete commands 2025-10-16 03:03:38 +00:00
Yuya Nishihara
4d9cfa65c1 cli: add tag set command
This is a stripped-down version of cmd_bookmark_set(). Since tags shouldn't
usually be rewritten, I've made it fail on updating existing tags by default.
2025-10-16 03:03:38 +00:00