Commit graph

1749 commits

Author SHA1 Message Date
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
Remo Senekowitsch
883d9879d2 cli complete: suggest tracking absent remote bookmarks
This is a follow-up to 937d88ff25,
which made this operation possible in the first place.
2025-10-15 20:20:07 +00:00
Gaëtan Lehmann
4be2aad955 op diff: -G as short version of --no-graph
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-10-15 17:21:29 +00:00
Gaëtan Lehmann
bb7c3c5b2d op show: -G as short version of --no-graph 2025-10-15 17:21:29 +00:00
Gaëtan Lehmann
bb072635a8 evolog: -G as short version of --no-graph 2025-10-15 17:21:29 +00:00
Gaëtan Lehmann
039863855c op log: -G as short version of --no-graph
To be consistent with `jj log -G`.
2025-10-15 17:21:29 +00:00
Yuya Nishihara
77e2c14d79 cli: git-push: allow pushing new bookmark to tracked remote
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-10-15 01:52:19 +00:00
Yuya Nishihara
9aaff6afbb cli: bookmark: fix list template to accept absent-tracked remote refs 2025-10-15 01:52:19 +00:00
Yuya Nishihara
937d88ff25 cli: bookmark: allow tracking/untracking absent remote bookmarks
#7072
2025-10-15 01:52:19 +00:00
Yuya Nishihara
82dd14fd85 git: ensure RemoteView is created for remote with no existing refs
This will help "jj bookmark track" know whether absent remote ref can be created
for the specified remote. "jj bookmark" subcommands shouldn't depend on
gix::Repository API.
2025-10-15 01:52:19 +00:00
Yuya Nishihara
429fec1ae3 git: export tag changes
Although we don't have "jj git tag set"/"delete" commands, this fixes weird undo
behavior #6325. The discussion in #6325 is derailed, but there would be another
issue for the "abandon unreachable" behavior.

Fixes #6325
2025-10-15 01:31:16 +00:00
ase
f34dbabd47 config: add support for --when.workspaces
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-10-14 17:50:07 +00:00
Remo Senekowitsch
9fd1ab78cd git: ensure untracked files are removed from index
Previously untracking a file with `jj file untrack` would not remove the
file from the git index (intent-to-add), making the output of
`jj status` and `git status` inconsistent.
2025-10-14 15:23:50 +00:00
Martin von Zweigbergk
017d34625b undo: hint about jj op restore when trying to undo merge operation 2025-10-14 05:19:46 +00:00
Remo Senekowitsch
6efaa210df cli: remove deprecated command backout 2025-10-13 16:49:23 +00:00
Martin von Zweigbergk
71661495b8 bisect: don't say that we run the provided command from the workspace root
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
I don't know if I planned to make the command run from the workspace
root but it doesn't currently do that. I don't think we should change
it either.
2025-10-12 23:50:50 +00:00
Martin von Zweigbergk
829b2ed261 bisect: deprecate --command <cmd> in favor of -- <cmd> <args>...
`jj bisect run --command` splits the argument on spaces, so
e.g. `--command 'cargo test'` will run `cargo` with `test` as
argument. It is hard to pass more complex commands to because we don't
parse e.g. quotes as the shell would (and we wouldn't match the user's
preferred shell even if we did).

This patch deprecates the `--command` argument in favor of positional
arguments, so the user can do things like this:

```
jj bisect run --range ..main -- bash -c 'jj duplicate -r xyz -B @ && cargo test'
```

That will run the tests with the `xyz` change applied.
2025-10-12 23:50:50 +00:00
bipul
72bfc1c96f config: add workspace-level configuration support
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
- Added support for workspace-specific configuration using `jj config` commands.
- Introduced `--workspace` option to `jj config edit`, `jj config set`, and `jj config unset`.
- Workspace configuration file is stored in `.jj/workspace-config.toml` per workspace.
- Simplified workspace path handling logic.
- Updated documentation and test snapshots to reflect new behavior.

This improves flexibility for users working across multiple workspaces.

Co-authored-by: Eidolon <furyhunter600@gmail.com>
Co-authored-by: ase <adam@sandbergericsson.se>
2025-10-12 14:43:12 +00:00
Joseph Lou
12d649223f template: Add template-aliases.empty_placeholder
This is similar to `description_placeholder` and provides a simple alias
to globally override the "(empty)" label to something else.
2025-10-11 16:44:28 +00:00
Gaëtan Lehmann
b3ea95ff59 squash: fix -A -B behavior
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
and add the corresponding test. The children of the new commit were not
properly rebased on their parents.

fix: #7636
2025-10-09 15:53:46 +00:00
Gaëtan Lehmann
39c73e403f metaedit: fix 'squash' in test name
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-10-09 07:29:04 +00:00
Gaëtan Lehmann
336d9f7997 metaedit: test multiple input revisions
We were previously only testing the edition on a single revision.
2025-10-09 07:29:04 +00:00
Bryce Berger
b9ad82b97a templates: add remote and * to bookmarks in builtin_log_redacted
Remote names are potentially sensitive? Unsure, so better to redact them.

For getting the "*": This could have been done without modifying the
Rust side, with e.g. `stringify(bookmark).ends_with("*")`. However, this
feels brittle.

With adding `.synced()` to the template language, bookmark formatting
_could_ be done entirely in templates now. I don't know if that's
desired, so leaving for a potential future commmit.
2025-10-08 12:48:27 +00:00
David Higgs
a9797552d7 metaedit: add --message option, fix: #7634 2025-10-07 00:54:16 +00:00
Steve Fink
14ca2edb7e cli: Make log -G be the short form of --no-graph
Closes #7638
2025-10-06 23:02:16 +00:00
Angel Ezquerra
dc59c66c12 metaedit: do not edit the change if the --author-timestamp matches the current timestamp (fixes #7602)
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-10-06 07:19:45 +00:00
Anton Älgmyr
41837fe930 bisect: Make bisect able to search for first good/bad revision in the range 2025-10-01 22:24:32 +00:00
Antonin Delpeuch
589ed8369c external_merge: pass the repo_path to the merge tool
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 follows Git's merge driver interface which makes this information
available using the `%P` variable. It is useful for merge drivers to
adapt their behaviour based on the type of file supplied.
2025-09-29 01:07:22 +00:00
Matt Stark
bf6c022831 cli util: Add the environment variable JJ_WORKSPACE_ROOT 2025-09-25 03:41:12 +00:00
Angel Ezquerra
df2c1ed474 config get: add support for displaying arrays and tables
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
Up until now, trying to get a config value that was an array or a table would fail with an error indicating that only values that can be converted to a string can be displayed. This change fixes that issue by converting arrays and tables into TOML format.
2025-09-24 16:51:11 +00:00
Yuya Nishihara
a89680d34b op_store: add remote tags storage and basic accessors
Git-tracking tags will be stored there. I don't have a concrete plan for proper
remote tags support, but I think tags fetched/pushed internally can be recorded
as remote tags.
2025-09-24 09:09:52 +00:00
Matt Stark
b1ef4f688a cli util: Make jj util exec act more transparently.
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
If a subprocess exits with a nonzero status, we don't need to print out
the fact that it exited with a nonzero status.

I think it is fairly obvious that we should try to match the return code
of the inner process.

In a bit more contention is whether we should print out the error
message at all. I would argue that a command that fails almost always
prints to stderr anyway, and the whole point of `jj util exec` is that
it should go into your aliases and thus the fact that it's an "external"
command should be hidden from the user (see my example above).

```
$ jj upload  # "upload" is an alias using jj util exec
<presubmit failures>
Error: presubmits failed
external command exited with 5
<exits with exit status 1>
```
2025-09-22 02:17:46 +00:00
Remo Senekowitsch
991e8b8b2c cli bookmark: warn on empty implicit target revision
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-09-21 10:27:43 +00:00
Yuya Nishihara
65d15d7ef6 cli: help: remove details from short description of "gerrit upload"
I also removed "If true," because --dry-run is a flag taking no value.
2025-09-19 09:41:26 +00:00
Martin von Zweigbergk
0ea94d07f4 gerrit: fix a misplaced comment in test 2025-09-19 07:06:04 +00:00
Theo Buehler
47d912d166 docs: document gerrit.default-branch, fix gerrit.default-remote
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 former wasn't mentioned in the doc comment, the latter with an
incorrect name, which I found confusing.
2025-09-19 01:56:58 +00:00
Matt Stark
1a4a74f7a0 gerrit: Fix bug where only the head commit would get a Change-Id 2025-09-19 00:45:03 +00:00
Reuven Lazarus
ff3cf64e78 templates: ensure unique prefixes in format_gerrit_change_id_trailer
Gerrit's web UI (like jj) recognizes unique ID prefixes, so a reference
like `I1234cdef` in a commit message or a review comment becomes a
hyperlink to the referenced change. Currently, every jj-produced change
begins with `I6a6a6964`, which makes that less useful. This moves the
fixed `6a6a6964` component to the end, so the prefix is unique.

Closes #7500.
2025-09-16 19:36:01 +00:00
Philip Metzger
6b4b2c7daf cli bookmark: un-deprecate default revset arguments
This is mostly a revert of dd73b5ab7d. It closes #5374, as feedback on
the issue has shown that many longtime and new users dislike it. Martin
himself also mentioned that he wants to walk back this deprecation.

Co-authored-by: Remo Senekowitsch <remo@buenzli.dev>
2025-09-16 17:11:38 +00:00
Austin Seipp
35ad063b85 cli: basic jj gerrit upload implementation
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 implements the most basic workflow for submitting changes to Gerrit,
through a verb called 'upload'. This verb is chosen to match the gerrit
documentation (https://gerrit-documentation.storage.googleapis.com/Documentation/3.12.1/user-upload.html).

Given a list of revsets (specified by multiple `-r` options), this will parse
the footers of every commit, collect them, insert a `Change-Id` based off the jj change-id (if one doesn't already exist), and then push them into the given remote.
It will then abandon the transaction, thus ensuring that gerrit change-IDs do not appear in jj.

Because the argument is a revset, you may submit entire trees of changes at
once, including multiple trees of independent changes, e.g.

    jj gerrit upload -r foo:: -r baz::

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-09-16 02:15:09 +00:00
Yuya Nishihara
84c7f5d562 cli: diff: pass $width parameter to external diff tools
Closes #4161
2025-09-16 01:49:21 +00:00
Martin von Zweigbergk
b6c5c23bf1 completion: match files in revision for file list
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-09-12 18:06:03 +00:00
Yuya Nishihara
af4fe21452 files, tree: make same-change conflict resolution configurable
I have no idea if we can change the default, but maybe we can conditionally
disable the same-change rule to get rid of hacks in squash_commits(), etc.?

resolve_file_executable() doesn't respect the Store configuration. I'm not sure
if that's the right choice, but it seemed better to accept duplicated change
than falling back to executable=false.

#6369
2025-09-11 13:14:28 +00:00
Remo Senekowitsch
0a965918d1 cli metaedit: fix --update-author if author was unset
The commit builder prepared by `rewriter.reparent()` already updates the
author to the currently configured one in case the author was previously
unset. When the new author is compared to `commit_builder.author()`,
they compare as equal, making it look like the author didn't change.
If that was the only change that would've happened, the commit is not
rewritten at all, meaning the commit author stays unset. This is fixed
by comparing the new author to the actual author of the old commit.
2025-09-11 13:03:43 +00:00
Yuya Nishihara
9589bec37a files: add option to resolve conflicts word by word
This option affects emptiness of commits, which means indexed changed files can
become stale on configuration change. This problem can also be said for changes
in the diff algorithms, so I don't think we need a logic to invalidate index on
config change.

I have this patch for months, and it seems working good at least for Rust
sources.

Closes #17
2025-09-09 03:44:16 +00:00
Remo Senekowitsch
51224ed675 cli: deprecate metaedit-functionality of commit and describe
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-09-08 06:00:35 +00:00
Ilya Grigoriev
93368f114f codespell: forbid British English
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 suggested by @PhilipMetzger

The word "grey" is whitelisted because
- we have a contributor of that name
- we use a library that uses "Grey" as a member of an enum
- I refuse to believe "grey" is not US English
2025-09-07 15:51:44 +00:00
Scott Taylor
51ad8a0d01 cli: commit: explain that jj describe && jj new is equivalent
Suggested in #7429.
2025-09-07 12:57:08 +00:00
Remo Senekowitsch
97823cafdf cli config: suggest metaedit over describe --reset-author 2025-09-07 10:01:11 +00:00
Gaëtan Lehmann
8a1297e6c4 status: fix markdown list rendered on a single line 2025-09-07 07:24:51 +00:00