8712 Commits

Author SHA1 Message Date
maan2003
ec6f8278fd signing: allow specifying sign behavior 2025-02-16 05:56:52 +00:00
Evan Mesterhazy
a4b064ea8d cli split: Move bookmarks to the first commit instead of the second
After even more discussion on Discord, we decided to use the new bookmark
behavior immediately and only print a warning during `jj split` if the user has
opted out of the new behavior using the `split.legacy-bookmark-behavior` config
setting.

The reasoning is that if the behavior change breaks someone's workflow or is
very disruptive, they are likely to check the changelog and learn about the
config option. For users that are not adversely impacted, printing a warning
that can only be silenced by changing their config is also disruptive.

#3419
2025-02-16 04:02:24 +00:00
Yuya Nishihara
5def466ac1 index, op_store: write temporary files in destination directory
This should be safer, and should be okay since we ignore invalid file names when
scanning the store directories.

Fixes #5712
2025-02-16 01:48:10 +00:00
Yuya Nishihara
be77d03bca op_store: extract functions that return views/operations dir paths 2025-02-16 01:48:10 +00:00
Yuya Nishihara
89fb97be88 op_store: refactor SimpleOpStore::init() to use self.path for initialization
I'm going to add helper functions that return these directory paths.
2025-02-16 01:48:10 +00:00
Yuya Nishihara
4ec22dde38 templater: port annotation line content to template
I originally thought we would have to add BString template type first, but we
can use opaque Template type instead.
2025-02-15 11:07:17 +00:00
Yuya Nishihara
6f51696600 templater: use property.map() to apply infallible transformation
Also renamed data to line as the type name was changed to AnnotationLine.
2025-02-15 11:07:17 +00:00
dependabot[bot]
e220fe39ef github: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [taiki-e/install-action](https://github.com/taiki-e/install-action) and [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `taiki-e/install-action` from 2.48.10 to 2.48.11
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](ae9d9ea210...297054b274)

Updates `astral-sh/setup-uv` from 4.2.0 to 5.2.2
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v4.2...4db96194c378173c656ce18a155ffc14a9fc4355)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
- dependency-name: astral-sh/setup-uv
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-15 08:59:56 +00:00
Bryce Berger
3bc111e60e annotate: make AnnotationLine template type
Allows:
* self.commit()
* self.line_number()
* self.first_line_in_hunk()

Certain pagers (like `delta`), when used for `git blame`, only show the
commit information for the first line in a hunk. This would be a nice
addition to `jj file annotate`.

`jj file annotate` already uses a template to control the rendering of
commit information --- `templates.annotate_commit_summary`. Instead of
a custom CLI flag, the tools necessary to do this should be available in
the template language.

If `1 % 2` or `1.is_even()` was available in the template language, this
would also allow alternating colors (using `raw_escape_sequence`).

Example:

```toml
[templates]
# only show commit info for the first line of each hunk
annotate_commit_summary = '''
if(first_line_in_hunk,
  show_commit_info(commit),
  pad_end(20, " "),
)
'''
```
2025-02-15 02:34:38 +00:00
Martin von Zweigbergk
6ec337e715 cargo: upgrade to latest streampager
This removes some dependencies on very old versions of the `dirs`
crate and a few others. Thanks to @quark-zju for getting a new
`sapling-streampager` released.
2025-02-15 02:24:02 +00:00
Martin von Zweigbergk
77fb50c8cd completion: mark git remote arguments as URL instead of path
Fixes #5704.
2025-02-15 01:59:16 +00:00
Bryce Berger
e4ad7b6c0f fix: add simple debugging logs
There's currently no way to tell what `jj fix` is doing. This adds some
traces such that `jj fix --debug` will at least tell you what's being
run and what it's exit code is, similar to other subprocessing code.
2025-02-15 01:13:17 +00:00
Philip Metzger
4a47a4fc1d commit: Add commit.is_hidden(repo)
Also simplify the `hidden()` revset with it.
2025-02-14 16:24:01 +00:00
Martin von Zweigbergk
5e896b22fe repo: make commit visible when pointing bookmark to it
This was discussed in the Discord a while ago, and this is the logical and consistent
conclusion. Implementing it as such makes it consistent with both `jj edit` and `jj new`
which make hidden commits such as predecessors visible.

This actually was Martins work, I just added the tests.

Co-Authored-by: martinvonz <martinvonz@google.com>
2025-02-14 16:24:01 +00:00
Austin Seipp
514a009675 github: add zizmor check to CI matrix
This should help us catch GHA security issues earlier.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
a3a658783b github: remove template injection vectors in release workflow
In theory this could be exploited by a contributor who pushes a tag with a
specifically crafted name in order to exfiltrate a `GITHUB_TOKEN` that has
permissions on the jj repository. This token would be scoped narrowly ideally,
but...

Today, Martin does releases manually, so this workflow currently does not e.g.
have the ability to upload a compromised package to crates.io. However in the
future we'd like to have the release done automatically via workflow as well,
which would make this potential injection vector catastrophic if the injection
was possible in a step with a crates.io API token available.

Found by `zizmor`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
7c1c1a7d4c github: narrow perms in release workflow
Found by `zizmor`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
c4b350b85d github: narrow perms in ci workflow
Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
3ca7f9b18b github: narrow perms in binaries workflow
Found by `zizmor`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
0ee37948de github: narrow perms in the docs workflow
Found by `zizmor`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
04a25d1ef4 github: narrow perms in dependabot workflow
The dependabot workflow already specifies the exact permissions it needs within
the workflow steps, so there's no need to enable any default permissions.

Found by `zizmor`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Austin Seipp
23f9d00dc6 github: narrow perms in scorecards workflow
This stops issuing overly broad permissions to the entire workflow and instead
scopes them to the necessary steps in the job.

Found by `zizmor`.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-02-14 09:38:49 +00:00
Benjamin Tan
e021036740 cli: backout: add templates.backout_description configuration
Closes #5676.
2025-02-14 07:56:40 +00:00
Josh Steadmon
23691a636c config-schema: validate default configs in tests with taplo
Set up tests using `taplo check --schema` to validate the default configs.
Install taplo in GitHub CI and in the Nix flake.

Fixes #5670.
2025-02-14 04:17:37 +00:00
Evan Mesterhazy
37992412b6 cli split: Recommend jj config set --user instead of --repo in deprecation warning
It only occurred to me after I rebuilt jj and actually had to run the command
that we should probably recommend a change to the user config instead of the
repo config.

#3419
2025-02-14 01:41:41 +00:00
Yuya Nishihara
381bb8a869 tests: create parent directory of .git link file by caller
It seems a bit safer to set up the working directory by caller who knows the
test environment directory exists.
2025-02-14 01:14:39 +00:00
Yuya Nishihara
d5493e6b10 tests: inline create_gitlink() option to caller
Since we don't set up Git worktree properly, it's odd that init_git_repo() has
a option to create a workspace at the specified path.
2025-02-14 01:14:39 +00:00
Yuya Nishihara
0d2becbac3 templater: add stringify(x) function to call string methods on template
It's also useful to remove color labels from the inner template.
2025-02-14 00:54:03 +00:00
Yuya Nishihara
78f08d9e6c docs: use single-quoted template string in JSON example
It's easier to parse than \".
2025-02-14 00:54:03 +00:00
Martin von Zweigbergk
5e694ea571 docs: record contributors whose employer pays for contributions
This adds a record of all contributing employees of companies who pay
for contributions. The purpose is to help make possible conflicts of
interest easier to spot. As far as we know, only Google currently pays
right now.
2025-02-13 21:52:02 +00:00
Evan Mesterhazy
d5d21643d5 cli split: Add a config option controlling how bookmarks move during splits
Currently, `jj split` moves bookmarks from the target revision to the second
revision created by the split. Since the first revision inherits the change id
of the target revision, moving the bookmarks to the first revision is less
surprising (i.e. the bookmarks stay with the change id). This no-implicit-move
behavior also aligns with how `jj abandon` drops bookmarks instead of moving
them to the parent revision.

Two releases from now, `jj split` will no longer move bookmarks to the second
revision created by the split. Instead, local bookmarks associated with the
target revision will move to the first revision created by the split (which
inherits the target revision's change id). You can opt out of this change by
setting `split.legacy-bookmark-behavior = true`, but this will likely be
removed in a future release. You can also try the new behavior now by setting
`split.legacy-bookmark-behavior = false`.

Users who have not opted into the new behavior via the config setting will see
a warning when they run `jj split` informing them about the change. The default
behavior be changed in the future.

The `jj split` tests for bookmarks are updated to run in all three configurations:

- Config setting enabled
- Config setting disabled
- Config setting unset


#3419
2025-02-13 21:45:56 +00:00
dependabot[bot]
ae59bd88cd github: bump taiki-e/install-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [taiki-e/install-action](https://github.com/taiki-e/install-action).


Updates `taiki-e/install-action` from 2.48.9 to 2.48.10
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](995f97569c...ae9d9ea210)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-13 18:56:58 +00:00
Ilya Grigoriev
d79c7a0dd5 mkdocs: update mkdocs-material and mkdocs-include-markdown-plugin
It's been about five months, and it seems best to occasionally try
updating. Let's see if this causes any problems.

There was also a minor breaking change to
`mkdocs-include-markdown-plugin`, I added an option to keep
the old behavior (which seems nice in this case).

To do these kinds of updates, `uv tree --outdated` is useful.
2025-02-13 17:30:21 +00:00
Samuel Tardieu
148e4235fd git: box gix::Repository large instances
`gix::Repository` instances are larger than 1KB on 64-bit machines. This
makes Clippy warn about an unbalance between variants of `GitFetchImpl`:
the `Git2` variant requires 8 bytes, while the `Subprocess` variant
requires 1128 bytes.

Boxing the `gix::Repository` makes `GitFetchImpl` instances smaller, as
well as the other structs embedding them such as `GitFetch`.
2025-02-13 08:10:02 +00:00
Matthew Davidson
204cffe386 Remove broken Sublime LSP TOML reference in config.md
Removes nonexistent Sublime TOML LSP server link. Since I wasn't able to find an alternative, I removed the Sublime bit entirely.
2025-02-13 04:44:39 +00:00
Evan Mesterhazy
b90e5af51c json schema: Fix bad indentation for jj fix settings
The fix settings weren't indented consistent with the rest of the settings,
causing them to appear in the redacted snapshot in the test_util_config_schema
test.
2025-02-13 02:37:19 +00:00
dependabot[bot]
61cab24c2f cargo: bump clap from 4.5.28 to 4.5.29 in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [clap](https://github.com/clap-rs/clap).


Updates `clap` from 4.5.28 to 4.5.29
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.28...clap_complete-v4.5.29)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-12 22:51:41 +00:00
hkalbasi
272955f4fe templater: add .escape_json method to string 2025-02-12 22:17:30 +00:00
Ilya Grigoriev
e83b328f71 ui.rs: style, fixup to 8aa2916 2025-02-12 21:25:37 +00:00
Josh Steadmon
69050f31f4 config-schema: expand options for ui.editor, ui.diff.tool, and ui.pager
In addition to a single string, the `ui.editor` and `ui.diff.tool` options also
allow arrays of strings. `ui.pager` allows arrays of strings as well as a nested
table describing both the command and the environment.

Update config-schema.json to allow all of these types of values.

Fixes #5617
2025-02-12 20:43:17 +00:00
Evan Mesterhazy
b2e2c79088 cli split: Move bookmark testing to a separate test
We are planning to add a config option that controls how bookmarks and change
ids move during `jj split` based on feedback in https://github.com/jj-vcs/jj/pull/5618.
I think the tests will be more readable after the config option is added if we
move the bookmark testing to its own test.

#3419
2025-02-12 19:45:37 +00:00
Baltasar Dinis
9ca6d179b2 cli/tests: port test_gitignore to gitoxide 2025-02-12 17:06:59 +00:00
Baltasar Dinis
6746942a06 cli/tests: port test_git_init to gitoxide
cargo-insta was re-run.
This is due to centralizing git interaction code to use a particular
different signature, which changes the commit hashes
2025-02-12 17:06:59 +00:00
Baltasar Dinis
18cd4d3010 cli/tests: add more gitoxide helpers
These are helpers for:
 - gitlinks
 - removing config values
 - symbolic references
 - status
 - index management
2025-02-12 17:06:59 +00:00
Yuya Nishihara
a1fe2dc95e git: trim trailing space in sideband messages received from git subprocess
Since git CLI appends "        " to sideband messages to overwrite the previous
line, we need to undo that. Our GitSidebandProgressMessageWriter expects
original sideband messages.
2025-02-12 01:25:53 +00:00
Ilya Grigoriev
a3647a6796 json schema: update some defaults to their modern values 2025-02-11 23:25:00 +00:00
Ilya Grigoriev
3f9e55ffee json schema: set schema version to draft-4, clarify taplo support
"$comment" is not officially supported by draft-4, but it is in newer
drafts, and JSON schema readers are supposed to skip fields that
are not known to them.
2025-02-11 23:25:00 +00:00
Ilya Grigoriev
dae1664ad3 json schema: fix color names failing validation
This makes the schema a bit less smart, but there's a good chance
`taplo` could not use "propertyNames" anyway because that comes
from a newer version of the schema than `taplo` officially supports
(see the child of this commit).

Fixes #5607
2025-02-11 23:25:00 +00:00
David Rieber
dd73b5ab7d bookmarks: First step to make target revision a required argument to bookmark create/move/set.
With this change a warning is shown if the user does not explicitly specify the target revision, but the behavior is unchanged (it still defaults to the working copy).
In the future the warning will be turned into an error. In other words, it will be required to specify target revision.

The bulk of the changes here are to prepare tests for the upcoming change, to make the transition easier.

For additional details please see:
* https://github.com/jj-vcs/jj/issues/5374
* https://github.com/jj-vcs/jj/discussions/5363
2025-02-11 22:21:19 +00:00
dependabot[bot]
b03350eaa1 cargo: bump toml_edit in the cargo-dependencies group
Bumps the cargo-dependencies group with 1 update: [toml_edit](https://github.com/toml-rs/toml).


Updates `toml_edit` from 0.22.23 to 0.22.24
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.23...v0.22.24)

---
updated-dependencies:
- dependency-name: toml_edit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-11 20:16:46 +00:00