Commit Graph

1749 Commits

Author SHA1 Message Date
Yuya Nishihara
d444f0578a cli: show warnings for unmatched exact bookmark/tag patterns to list
The idea is the same as filesets. We emit warnings for exact names that don't
exist in the search space.
2025-11-26 14:46:17 +00:00
Ilya Grigoriev
f0b0171bc5 deps: update gix, test change 2025-11-26 01:14:58 +00:00
Ilya Grigoriev
4b0f493abb test_git_clone: update test to prepare for gitoxide update
The next version of gix would pass invalid port number and
jj would pass the URL to the git binary, resulting in a
different error.
2025-11-26 01:14:58 +00:00
dependabot[bot]
2f0132a765 deps: update insta 2025-11-26 01:14:58 +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
Ilya Grigoriev
88b76bfdc9 deps: update jsonschema to 0.37.1, adapt to breaking changes
I naively followed the instructions from
https://github.com/Stranger6667/jsonschema/blob/master/MIGRATION.md
2025-11-25 17:58:09 +00:00
Kaiyi Li
0328e0e86b cli: simplify jj fix child process handling
* `Some(x).unwrap()` is not necessary.
* Add a new test to ensure that we handle the fix child process IO
  without deadlock. The new test introduces byte mode to fake-formatter
  which pipe the stdin contents to stdout byte by byte in a streaming
  fashion. The test contents are 512KB, which is larger than page size,
  can trigger the blocking read behavior, and doesn't make the test the
  slowest.
2025-11-25 15:54:00 +00:00
Kaiyi Li
70ddaf8c6f fix: change fake-formatter to not emit ending LF
If the original file doesn't end with LF, the output file won't end with
LF.
2025-11-25 15:54:00 +00:00
Fedor
c2815cdce0 tests: assert operation description text in Git HEAD race test
Add an assertion that verifies the operation description actually
contains "import git head". This prevents the test from being
nullified if the operation description changes in the future.
2025-11-25 14:18:44 +00:00
Fedor
7a296ca1fe cli: fix Git HEAD race condition in colocated repos
Concurrent jj processes in colocated Git repos could create divergent
operations when importing/exporting Git HEAD. This change prevents the
race where two processes both load the repo at operation X, then create
divergent operations Y and Z with the same parent.

Fix by introducing a dedicated lock (.jj/repo/git_import_export.lock)
that serialises Git HEAD and refs import/export. The lock is acquired
in maybe_snapshot_impl() and finish_transaction(). After acquiring the
lock, we reload the repo at the current head to avoid creating operations
based on stale state.
2025-11-25 14:18:44 +00:00
Fedor
aa4d71454d tests: add test for Git HEAD race condition
Add a probabilistic test that spawns two jj processes in parallel:
one running `jj debug snapshot` (imports Git HEAD) and another
running `jj next/prev` (exports Git HEAD). The test creates large
commits to increase the race window and should fail when the race
condition exists. The race condition is fixed in the next commit.
2025-11-25 14:18:44 +00:00
Yuya Nishihara
c93682f218 revset: parameterize default string pattern kind, add config knob
Glob patterns will be enabled by default globally. Since this will be a big
breaking change in revsets, this patch adds a config knob to turn the new
default on/off.
2025-11-24 01:39:32 +00:00
Yuya Nishihara
3b37ed102e tests: specify string pattern prefix, use subject(glob:_) accordingly
Deprecation warnings will be emitted for default "substring:" patterns. This
change will suppress them. Since "glob:" will be the new default, I made these
tests use "glob:" when both "exact:" and "glob:" work.

Tests for the revset filter functions aren't updated.
2025-11-24 01:39:32 +00:00
Yuya Nishihara
3f88ea78f1 cli: use revset parser to parse bookmark/tag list patterns
These commands are easy ones. The other commands error out if one of the
patterns doesn't match anything. I'll make them warn only exact patterns instead
to keep the implementation simple. I'll also add warnings to these list
commands.
2025-11-23 03:00:12 +00:00
Yuya Nishihara
69c36fe1b9 revset: restore parsing rule for expression without "modifier:" syntax
The new parse_program() will allow us to parse top-level string patterns with no
parentheses. This patch also replaces a few callers of the old parse_program().
When we drop support for the all: modifier syntax, parse_program_with_modifier()
will be replaced entirely.
2025-11-23 03:00:12 +00:00
ase
c598135f64 docs: clarify that squash -o/A/B creates a new commit 2025-11-22 22:24:24 +00:00
David Higgs
1ddada1a24 tests: exercise more tracking conflict cases 2025-11-22 14:38:53 +00:00
David Higgs
58edd0f731 tests: exercise renaming an untracked bookmark 2025-11-22 14:38:53 +00:00
David Higgs
7afa6273ca tests: exercise tracking non-existent remote bookmarks 2025-11-22 14:38:53 +00:00
David Higgs
062f950be3 tests: exercise moving multiple bookmarks by name 2025-11-22 14:38:53 +00:00
Remo Senekowitsch
244cbf7d45 cli git push: deprecate --allow-new 2025-11-22 08:18:44 +00:00
Remo Senekowitsch
faf5512482 tests: replace --allow-new with auto-track-bookmarks
This paves the way to deprecate the `--allow-new` flag on `jj git push`
without adding lots of deprecation warnings to test output snapshots.

The behavior of some tests is slightly changed, because
auto-track-bookmarks tracks all bookmarks at creation time, not when
they're about to be pushed. Where appropriate, I tracked bookmarks
manually instead of via the auto-track config.
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
Yuya Nishihara
54511ee3fd tests: stop relying on auto tracking when setting up commit template test
Since this is a test for template output of various bookmark states, it's better
to not rely on implicit configuration. Local bookmark "new-bookmark" wasn't
tracked before.
2025-11-21 15:31:35 +00:00
Remo Senekowitsch
5ada0f7ff2 config: deprecate git.auto-local-bookmark 2025-11-21 05:15:55 +00:00
Remo Senekowitsch
e4d45dda34 tests: replace auto-local-bookmark with auto-track-bookmarks
This paves the way to deprecate `git.auto-local-bookmark` without
adding lots of deprecation warnings to test output snapshots.

The behavior of some tests is slightly changed, because
auto-track-bookmarks also tracks bookmarks that were created locally.
I think it just shows up in output snapshots as absent-tracked
bookmarks, without affecting what the test is about.
2025-11-21 05:15:55 +00:00
Yuya Nishihara
5330081be2 templates: ensure empty description in compact_full_description is terminated
I thought the lack of newline would be intentional when I added explicit ++ "\n"
by 4495574171 "templater: do not implicitly add final newline character to
commit.description", but that seems wrong. The compact_full_description template
would be largely copied from the compact template, and the author wouldn't
notice that .first_line() strips newline?

Suppose this template is closer to comfortable/detailed templates, a blank line
should also be inserted to the root commit.

Fixes #8073
2025-11-21 01:48:23 +00:00
Björn Kautler
a76f2c4dac docs: fix markdown sublists for the produced web pages 2025-11-19 03:53:18 +00:00
Remo Senekowitsch
e22bc2d391 cli: remove legacy macos config dir 2025-11-18 17:30:17 +00:00
Remo Senekowitsch
4216aa6758 config: add remotes.<name>.auto-track-bookmarks
This configuration allows users to express a set of bookmarks that
should be automatically tracked when first encountered. This includes
on clone, fetch, create and set.

Until now, the configuration values `git.push-new-bookmarks` and
`git.auto-local-bookmark` fulfilled parts of those use cases. However,
both options represent an "all or nothing" approach. By turning them on,
users risk tracking and pushing more bookmarks than desired.

By using a bookmark pattern, users can express that they want to
auto-track bookmarks that belong to them (e.g. `glob:my-name/*`).
2025-11-18 15:10:56 +00:00
Hubert Lefevre
0b3cbd9809 cli: complete: Fix completion for workspace
The character used for splitting the argument from its description /
help text was incorrect. In the template syntax used to obtain those
information, a tab ('\t') was used, while the parsing split the line
base on the pattern ": ".

The result was that the suggested argument for completion was
systematically incorrect, as the help text is systematically added, with
a default to "(no description set)".

The test was also incorrect, the expected pattern, for each line, was
'<value>\t<description>' since <value> was actually
`<value>\t<description>` the test was badly configured to expect
`<value>\t<description>\t'.
2025-11-18 15:10:09 +00:00
Gaëtan Lehmann
40c16fc711 prev/next: add an error when not using --edit and the working-copy has children
We shouldn't be in that case, and it can lead to confusing situations with next
completely switching branch.

fix: #7046
2025-11-18 10:19:38 +00:00
Yuya Nishihara
8091682c0b revset: allow unquoted * in identifier (or pattern expression)
I'm going to fix parsing of CLI string patterns to use revset parser, and it
would be annoying if inner quotes were required in addition to shell quotes:

  $ jj bookmark list 'glob:"push-*"'

There's also a plan to enable glob matching globally. This will mean that we'll
have to use either `subject(*foo*)` or `subject(substring:foo)` for substring
search.

https://github.com/jj-vcs/jj/issues/6971#issuecomment-3067038313
2025-11-15 04:11:57 +00:00
Martin von Zweigbergk
1c2d2c5f3c cli: warn when jj file list fileset doesn't match
Looks like we missed this one.
2025-11-14 14:51:27 +00:00
Martin von Zweigbergk
72500be2fc cli: add test of jj file list 2025-11-14 14:51:27 +00:00
Martin von Zweigbergk
369d45536c cli: warn when jj file untrack fileset doesn't match 2025-11-14 13:51:01 +00:00
Lucio Franco
d9f2772988 cli: add jj file track --include-ignored flag
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
Tejas Sanap
7b32e10ffa cli: jj absorb warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
9bc596ce6d cli: jj fix warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
cbfdb45c03 cli: jj interdiff warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
10c6641939 cli: jj log warns when fileset doesn't exist
We inline `print_unmatched_explicit_paths` when displaying the log as graph
for performance reasons.
2025-11-10 22:56:32 +00:00
Tejas Sanap
fc65d35306 cli: jj resolve warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
a68651dac8 cli: jj restore warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
0c6529d1cc cli: jj split warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
d5355b4135 cli: jj squash warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Tejas Sanap
731d75b251 cli: jj status warns when fileset doesn't exist 2025-11-10 22:56:32 +00:00
Jonas Greitemann
47553b5d6d completion: normalize file paths to forward slashes
Fixes #7024.

On Windows, where the native path separator is `\`, either `/` or `\`
can be used (at least in PowerShell which's supported by clap-complete).
To ensure that the input string indeed prefixes the candidate paths,
we now normalize both to use forward slashes. The remainder which is
spliced onto the input string will thus use forward slashes on all
platforms. That way, the completion is now also usable in git-bash.exe
(Git for Windows with `COMPLETE=bash`). When using dynamic completion
with PowerShell, the completion results are still valid, as PowerShell
can tolerate forward slashes.
2025-11-10 19:59:25 +00:00
Jonas Greitemann
b7233249d1 completion: avoid panic when completing non-normal paths
Fixes #6861.

In the original `dir_prefix_from` function, `current` might not be a
prefix of the (normal) completion candidate `path` if `current` itself
is non-normal. In case `current` is longer than the candidate `path`,
the code previously panicked. The tests have been extended to trigger
this panic.

This commit rewrites how the file-path completion is determined from
a potentially non-normal `current_prefix`. The panic is avoided by
using `strip_prefix()` instead of direct slicing. The basic idea is to
normalize the `current_prefix` first to obtain an actual prefix of the
(normal) `path`. The remainder can then be spliced onto the original
`current_prefix` to form a non-normalized completion path that is
prefixed by `current_prefix`, allowing the shell to accept it.

This requires a different API for the helper than what `dir_prefix_from`
provided. The latter assumed that when `None` was returned, `path` could
be completed as-is; a `Some` value indicated a partial completion of
`path` to the next directory. This is no longer sufficient as we need to
potentially return a different, non-normal path in either case.

Since we want to ignore the `mode` for directory completions, the
helper must also return the type of completion (partial/directory
or full/file). To avoid propagating this information, I instead
pass the `mode` into the helper and have it return finished
`CompletionCandidate`s. This arguably yields cleaner code on the caller
side, too.
2025-11-10 19:59:25 +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