* `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.
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.
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.
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.
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.
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.
Suppose the default is changed to "glob:", literal strings would be parsed by
glob() function. It's still better to treat trivial strings as "exact" patterns.
str_util::is_glob_char() includes backslash unconditionally because we enable
backslash escapes in string 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.
The default patterns differ between revsets and command arguments, but they'll
be unified to "glob" later. For now, parse_string_expression() should be used
only for command arguments.
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.
Changed to be consistent, at least in the same file, and avoid
using sometime repository/repositories and other times repo/repos.
"repo/repos" is currently the most use terminology.
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.
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.
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.
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
The comment was deleted in e22bc2d391,
which removed code related to the legacy macos config dir. However, the
comment was related to `jj_lib::config::migrate()`, so it shouldn't have
been deleted.
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/*`).
For completion of workspace names, we are parsing a content where each
line should have a tab, separating a candidate workspace name from the
working copy commit description, serving as help text for the value.
If we cannot parse one of the lines, instead of proposing a bad value,
print an error message and ignore the line.
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'.
Long options are self-explanatory compared to short ones.
This make the choice in options consistent with the rest of the file,
where --template is systematically used over -T.