Commit Graph

401 Commits

Author SHA1 Message Date
Martin von Zweigbergk
3fdd025688 status: in help text, add pointer to jj diff -s -r
It seems somewhat common that users want the `jj diff -s` output from
`jj show` for another revision, so let's add a pointer to it.
2026-02-04 00:24:11 +00:00
Yuya Nishihara
9bfc8480ff cli: git fetch: disable default when --branch or --tag is specified
This behavior is similar to "jj git push". If we add "jj git push --tag" option,
it would disable the default revset.

No changelog entry is added because "jj git fetch --tag" isn't released yet.
It's also experimental.
2026-02-03 00:23:40 +00:00
Jonas Helgemo
2f3e21ebee docs: add --author flag usage examples for the metaedit command
- Added example command showing --author flag usage to metaedit.rs

The docs show examples for other similar commands, but not for the
author command. Since the format is not obvious an example is helpful.
2026-01-26 17:16:31 +00:00
Steve Klabnik
6302b8b9ed cli: fix --git-repo being ignored when git.colocate config is true
When `git.colocate` config is true (the default), the `--git-repo` flag
for `jj git init` was silently ignored. This happened because the
colocate logic was checked before the --git-repo logic:

    let colocate = if command.settings().get_bool("git.colocate")? {
        !args.no_colocate  // true unless --no-colocate passed
    } else {
        args.colocate
    };

Then in `do_init()`:

    let init_mode = if colocate {
        // takes this branch, ignoring --git-repo!
    } else if let Some(path_str) = git_repo {
        // --git-repo handling never reached
    }

This meant `--git-repo` was simply ignored unless `--no-colocate` was also
passed.

This is a regression from when colocation became the default. Before
that change, `--git-repo` worked without any additional flags because
`colocate` defaulted to false. The fix preserves that original behavior
by checking for `--git-repo` first and setting `colocate = false` when
it's provided, allowing the --git-repo code path to be reached.
2026-01-23 20:00:30 +00:00
Paul Smith
c64d42eecd workspace add: add -m/--message flag for setting commit description
This change adds the ability to provide a description for the commit
when a workspace is added.

Example:

```
$ jj workspace add -m "wip bugfix" --name bugfix ../bugfix
Created workspace in "../bugfix"
Working copy  (@) now at: xmskztnv 564c419d (empty) wip bugfix
Parent commit (@-)      : zzzzzzzz 00000000 (empty) (no description set)
```

Currently, when a workspace is added, the new (empty) commit that is
created has no description set.

This change to `workspace add` mirrors the option to the `new` command,
which can take zero or more `-m/--message` flags for setting the
description for a new commit. The same logic for creating the new commit
for a workspace applies in terms of parent revisions, so this change
brings `new` and `workspace add` closer together in terms of CLI
affordances.

Similary to `new`, this change permits multiple message flags to be
supplied on the CLI. It also retains the behavior of not otherwise
creating a description of just trailers if no message flag were supplied
but trailers were set.
2026-01-22 23:10:55 +00:00
Pavan Kumar Sunkara
69d808fe0a workspaces: Allow retrieving the path of another workspace
This allows `jj workspace root` command to take an optional workspace
arg to print the root directory of that workspace, while defaulting to
the current workspace.

We allow this by creating a new `workspace_store` which has a separate
entry for each workspace containing its name and root directory. This
store is created during initiation of the repo and is maintained
whenever `add`, `forget` & `rename` workspace subcommands are executed.

CAUTION: Moving a workspace path will not sync the path stored in the
workspace store.

CAUTION: Specifying `jj workspace root` with a workspace created before
this will result in an error.
2026-01-21 21:04:39 +00:00
Steve Klabnik
916f9b1f6d cli: clarify difference between bookmark set and bookmark move
Update the help text to (hopefully) make the distinction clearer, and show the relationship between these two commands.

Fixes #8014
2026-01-20 23:23:52 +00:00
Martin von Zweigbergk
1f02aaff58 cli: add jj op integrate command for adding operation to op log
When `.jj/working_copy/checkout` refers to an operation that's not in
the op heads, there can be a few different cases. It's typically
simply behind or ahead, but it can also be a sibling. Until we
implement `--no-commit-transaction`, it would indicate a bug if that
happens. However, it does happen sometimes (rarely) at Google where we
can fail to flush the update of the op heads to the server for some
reason, but since we optimistically assume that it will succeed, we
update the working copy to refer to the operation before we have
flushed the op-head update. When in this state, we currently print an
error saying that the repo operation is a sibling of the working
copy's operation, but we don't provide a way of fixing it. This patch
provides a command for fixing this state. It will also be useful once
we have `--no-commit-transaction` (which will presumably print the
un-integrated operation id).

We currently call the process of adding an operation to the operation
heads "publish" in the code. I still went with "integrate" here
because I think it's clearer. If we go with "integrate", we can rename
the internal uses of "publish" to match in a follow-up. Other
reasonable verbs include "record" and "accept". Or we can of course go
with "publish".
2026-01-16 05:50:56 +00:00
Yuya Nishihara
d71026acad cli: tag list: port -rREVSETS filter from "bookmark list"
Closes #7930
2026-01-15 01:32:35 +00:00
Yuya Nishihara
8eae34d889 cli: tag list: include remote tags if --all-remotes is specified
This will be needed in order to write CLI tests of tags fetched to @<remote>
namespace. --remote and --tracked are hidden for now because they are useless
without remote tags support. --all-remotes is used as a flag to show both local
and @git remote tags. No changelog entry is added because this feature is
useless except for debugging or testing.
2026-01-14 00:06:14 +00:00
Matt Stark
fcf1da9936 config: Implement secure-config design doc.
See docs/design/secure-config.md for many more details.

Fixes #3303
Fixes #1595
2026-01-12 01:33:24 +00:00
Remo Senekowitsch
c4e0b4176e cli git push: allow pushing explicitly named bookmarks
By explicitly naming the bookmark to push, users already express their
intent to push that particular bookmark. Requiring them to express
that intent a second time by manually marking the bookmark as tracked
is therefore unnecessary.

There is an exception if the bookmark is already tracked with some
remote. In that case, the user may have forgotten to specify --remote
and creating the bookmark on a different remote may be a mistake.

closes #8387
2026-01-10 05:38:29 +00:00
Vincent Ging Ho Yim
339f57a81c cli parallelize: add -r option
This brings `jj parallelize` in line with other commands such as `jj new` and `jj
duplicate` that take a `-r` option in addition to the positional argument.
2026-01-08 10:15:43 +00:00
Vincent Ging Ho Yim
dfc012bd3f cli: rename {GitCloneArgs,GitFetchArgs}::branch to ::branches
For consistency with other `Option<Vec<String>>` fields in CLI command structs.
2026-01-08 10:10:57 +00:00
Yuya Nishihara
67253467f5 docs: say "tracked remote bookmarks" in command help
This matches the terminology described in the bookmarks documentation. A local
bookmark tracks remote bookmarks of the same name.
2026-01-06 01:03:57 +00:00
Yuya Nishihara
50b469109a cli: tag list: add --sort flag and config knob
This isn't exactly the same as what the reporter proposed in #8030, but it
should usually work since versions are roughly assigned in chronological
order. We can add --sort=name-as-version later if needed.

This patch also adds missed drop(formatter).

Closes #8030
2026-01-05 00:08:02 +00:00
Carlos Knippschild
09c5118296 docs: add missing run in bisect command line example 2025-12-31 23:32:43 +00:00
Ori Avtalion
d31b04904f docs: Mention -o flag instead of -d 2025-12-30 19:09:34 +00:00
Bryce Berger
b6cc5c0e15 metaedit: fix timestamp in help text
rfc2822, and by extension chrono's parser for rfc2822, only supports a
limited number of timezones (4.3, "Obsolete Date and Time"). JST is not
one of the enumerated zones.

Current fix is to just use a supported time zone in the example. It's
still possible to use a non-enumerated timezone with a human-readable
format by giving the timezone offset directly (`-0800` for PST).

fixes #8421
2025-12-28 19:10:01 +00:00
Martin von Zweigbergk
4dd845db2e cli: indicate -d as alias for -o in help
We have had two users at Google in the last few days how have wondered
why there's no documentation for the `-d` flags. Of course, the answer
is that they're deprecated, but given how long they have been
available, many users are already use them frequently. Perhaps they
then look at `jj rebase --help` to figure out what `-d` really means
and how it's different from `-A` or `-B`. It's the confusing that they
are not mentioned at all.
2025-12-24 20:30:06 +00:00
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 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
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)
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
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
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 2025-12-06 01:04:00 +00:00
edef
da9924c75f cli: default Gerrit --remote-branch is gerrit.default-remote-branch
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
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
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 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