893 Commits

Author SHA1 Message Date
Yuya Nishihara
d46c384db2 changelog: remove redundant entry about macOS config path
It's documented as deprecation, and is not actually a "bug".
2025-05-05 13:15:10 +00:00
Daniel Luz
87f6db0a70 completion: revset expression completer 2025-05-05 02:54:51 +00:00
Nicole Patricia Mazzuca
b568bb67f0 config: deprecate macOS legacy platform configs 2025-05-02 20:05:24 +00:00
Nicole Patricia Mazzuca
6f6496ba83 config: default to XDG config files on macOS
Support existing users with the "legacy" config directory, as well.
This will be deprecated in a latter commit.
2025-05-02 20:05:24 +00:00
Théo Daron
3ab9e098d7 cli config edit: Rollback to previous config when invalid TOML is saved 2025-04-29 16:26:11 +00:00
Jonas Greitemann
928984019f completion: fix completion of arguments for aliases/default-command in bash and zsh
This also adds a test case for the completion of arguments following
multi-argument aliases, to cover the bug reported in issue #5377.

The default command is like a special kind of alias, one which is
expanded from zero tokens. Consequently, it also triggers the bug
#5377 on bash/zsh, even if the `default-command` is just a single token.

The fix is along the lines sketched out by the "TODO" comment. Bash and
Zsh don't behave identical, so the padding ([""]) still needs to be
applied (and removed) conditionally in a disciplined manner.
2025-04-29 14:38:25 +00:00
Mateus Auler
968806bc64 templates: implement Commit.trailers() 2025-04-27 18:29:25 +00:00
Yuya Nishihara
6e67d79c10 merge-tools: builtin: parse conflict hunks back to merge value
Closes #4963
2025-04-27 01:33:48 +00:00
Jacob Hayes
1cdd79071e git: tolerate unknown git.fetch remotes if others are available
If `git.fetch` contains remotes that are not available, we currently error even
if other remotes are available. For common fork workflows with separate
`upstream` and `origin` remotes (for example), this requires a user to either
set both remotes in their user config and override single-remote repos or set
only one in their user config and override all multi-remote repos to fetch from
`upstream` (or both).

This change updates fetching to only *warn* about unknown remotes **if** other
remotes are available. If none of the configured remotes are available, an error
is still raised as before.
2025-04-25 14:06:53 +00:00
Martin von Zweigbergk
146900a071 cli: put editor-*.jjdescription file in /tmp instead of .jj/repo/
When we ask the user to prodive a commit description, we currently
write a file to `.jj/repo/` with the draft description and then pass
that to the editor. If the editor exits with an error status, we leave
the file in place and tell the user about the path so they can recover
the description. I'm not sure I've ever used one of these files. I
have certainly never used a file that's not from the most recent
edit. I have, however, cleaned up old such files. This patch changes
the code so we write them to /tmp instead, so we get the cleanup for
free.
2025-04-25 02:08:30 +00:00
Sam
001801a3b1 cli: add config option for built-in pager's ruler 2025-04-23 03:16:58 +00:00
Yuya Nishihara
af9c608ca5 config: migrate ui.default-description to template alias
Since we now have the template alias, it's easy to migrate the config value
programatically. However, there are a couple of minor behavior changes:

 a. default description won't be used if user customized the
    draft_commit_description template.
 b. default description won't be inserted if trailer is added

For (a), I assumed user would inline the default description in the draft
template if they customized the template. (b) should be okay because the
trailers template is a new feature.
2025-04-21 14:39:47 +00:00
Martin von Zweigbergk
15351a2d92 templates: extract a template alias as hook for default commit description
This makes it easier to override just the default description without
having copy the whole default template (and having to keep it up to
date with new versions).
2025-04-19 05:42:52 +00:00
Yuya Nishihara
6cba6d7ec2 cli: git-push: do not move existing local bookmarks by --change
An existing "push-*" bookmark should usually be in position. If it wasn't
because of e.g split, I think the user should be aware of that and take an
explicit action.
2025-04-19 01:26:40 +00:00
Gaëtan Lehmann
fae66ace9b split: add trailer support 2025-04-18 16:48:01 +00:00
Gaëtan Lehmann
6d240be777 squash: add trailer support 2025-04-18 16:35:16 +00:00
Yuya Nishihara
39f481f2da absorb: add basic support for file deletion
This works if the file was added and wasn't modified within the destination
range.

Closes #6140
2025-04-17 18:10:23 +00:00
Gaëtan Lehmann
2a7b0211eb new: add trailer support 2025-04-17 13:29:49 +00:00
Winter
af60f3d674 cli: deprecate ui.default-description
Closes https://github.com/jj-vcs/jj/issues/6298.
2025-04-17 02:03:48 +00:00
Gaëtan Lehmann
5f7159d4b1 commit: add trailer support 2025-04-16 14:21:35 +00:00
Winter
f3c4cc2155 cli: duplicate: add setting for templating the new commit descriptions
This allows the customization of the duplicated commit descriptions.

An ideal use case for this is emulating `git cherry-pick -x`, as
illustrated in the tests.
2025-04-13 21:49:47 +00:00
Gaëtan Lehmann
71a0194ad1 describe: add trailer support
Add a new `template.commit_trailer` configuration option. This template
is used to add some trailers to the commit description.

A new trailer paragraph is created if no trailer paragraph is found in
the commit description.
The trailer is not added to the trailer paragraph when the trailer is
already present, or if the commit description is empty.
2025-04-13 20:36:11 +00:00
Yuya Nishihara
fa00775f94 cli: resolve: do not use .with_new_file_ids() to construct resolved file value
This reverts a01d0bf7738f "cli: resolve: leave executable bit unchanged when
using external tool", and updates handling of resolved content.

Fixes #6250
2025-04-13 02:02:58 +00:00
Nils Koch
fbaa51b4ce revset: add signed function 2025-04-12 14:14:26 +00:00
Benjamin Brittain
0b6d0a7a75 git_backend: derive the change ID from the git change-id header
When read/writing commits from the git-backend, populate the git commit
header with a backwards hash of the `change-id`. This should enable
preserving change identity across various git remotes assuming a
cooperative git server that doesn't strip the git header.

This feature is behind a `git.write-change-id-header` configuration flag
at least to start.
2025-04-09 16:42:56 +00:00
Emily
e5478bbf7b cargo: use gix/zlib-rs feature
This uses `zlib-rs`, a native Rust library that is comparable in
performance to `zlib-ng`. Since there’s no complicated C build
and gitoxide only has one hashing backend now, this lets us drop our
`packaging` feature without adding any awkward build requirements.

`zlib-rs` is generally faster at decompression than
`zlib-ng`, and faster at compression on levels 6 and 9; see
<https://trifectatech.org/blog/zlib-rs-is-faster-than-c/>
for details.

I couldn’t get reliable‐looking benchmark results out of my
temperamental laptop; `hyperfine` seemed to think that some random
`jj` workloads I tested might be slightly slower than with `zlib-ng`,
but it wasn’t unambiguously distinguishable from noise, so I’d
like to see measurements from others.

It’s certainly a lot faster than the previous default, and I
think it’s likely that `zlib-rs` will continue to get faster
and that it’s more than worth avoiding the headaches of a native
library with a CMake build dependency. (Though on the other hand,
if distributions move in the direction of shipping `zlib-ng` by
default, maybe there will be more motivation to make `libz-ng-sys`
support system libraries.)
2025-04-08 22:12:25 +00:00
Emily
333d47f5e5 git: add deprecation warnings for git.subprocess 2025-04-08 10:36:46 +00:00
Yuya Nishihara
b63ab33b10 diff: add option to render color-words diffs without materializing conflicts
The original idea was to flatten left/right conflict trees and pair up adjacent
negative/positive terms. For example, diff(A, B-C+D) could be rendered as
diff(A, B) and diff(C, D). The problem of this formalization is that one of the
diff pairs is often empty (because e.g. A=B), so the context is fully omitted.
The resulting diff(C, D) doesn't provide any notion why the hunk is conflicted,
and how it is different from A.

Instead, this patch implements diffs in which each left/right pair is compared.
In the example above, the left terms are padded, and the diffs are rendered as
diff(A, B), diff(-A, -C), diff(A, D). This appears to be working reasonably well
so long as either side is resolved or both sides have the same numbers of terms.

Closes #4062
2025-04-08 09:12:39 +00:00
Aleksey Kuznetsov
3eaff83bca cli: Add config setting for bookmark list sort order
This is a conclusion of #5849.
Config setting to list bookmarks in specified order.

Closes #3831
2025-04-08 08:06:29 +00:00
Martin von Zweigbergk
3e51038dc5
release: merge 0.28 release branch into main 2025-04-07 22:04:11 -07:00
Yuya Nishihara
b9ebe2f03c release: 0.28.2 2025-04-07 08:42:32 -07:00
Yuya Nishihara
a5d672ca0f cargo: bump gix and its dependencies recursively
This should fix git::import_refs() issue with gix 0.71.0. Old commits could be
repopulated by importing stale refs stored in packed-refs.

https://github.com/GitoxideLabs/gitoxide/issues/1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
2025-04-07 08:42:32 -07:00
Yuya Nishihara
30134e523b cargo: bump gix and its dependencies recursively
This should fix git::import_refs() issue with gix 0.71.0. Old commits could be
repopulated by importing stale refs stored in packed-refs.

https://github.com/GitoxideLabs/gitoxide/issues/1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
2025-04-06 10:59:40 +00:00
George Christou
47b7717e69 cli show: add --no-patch flag 2025-04-05 16:41:32 +00:00
Emily
97c6fb979b changelog: add missing release highlights section
It would be tragic if 0.29 didn’t have any of these.
2025-04-05 07:30:10 +00:00
Waleed Khan
3aac8d21e6 release: 0.28.1 2025-04-05 03:45:18 +00:00
Emily
350da7d013 cargo: bump gix to 0.71.0
Fix GHSA-794x-2rpg-rfgr.

`gix::Repository::work_dir` was renamed to `workdir` (though strangely
not the `gix::ThreadSafeRepository` version), and `lossy_config`
is now off by default in all configurations.
2025-04-04 04:28:42 +00:00
Waleed Khan
3a98c4e849 release: 0.28.0 2025-04-02 23:52:10 +00:00
Scott Taylor
a902e63e65 merge_tools: add ":ours" and ":theirs" merge tools
We may want to implement these as options to `jj resolve` instead in the
future, but this is a simpler solution for now.
2025-04-02 22:09:15 +00:00
Aleksey Kuznetsov
3c907cc019 cli: Add --sort option to the bookmark list command
This allows different sort orders for the bookmarks list, not only
alphabetically (by name).

Relates to #3831
2025-04-02 14:46:20 +00:00
Martin von Zweigbergk
9763143d65 fix: always rewrite descendants of fixed commits 2025-04-02 14:04:08 +00:00
Remo Senekowitsch
fb1a27ff09 cli: require --deleted to push deleted bookmarks 2025-04-01 15:58:50 +00:00
Ilya Grigoriev
9db0739320 cli git push: new --named NAME=REVISION argument to create and immediately push bookmark
Fixes #5472
2025-03-31 03:51:28 +00:00
Yuya Nishihara
15e5bf7188 changelog: restore "Fixed bugs" heading removed at 68ef93ebd6e0 2025-03-30 02:17:00 +00:00
Jakob Hellermann
68ef93ebd6 cli: add revsets.log-graph-prioritize setting
The option will be used to prioritize branches of the `jj log` graph to
be displayed on the left.
This can make them more readable in some situations.
An example would be
```
[revsets]
log-graph-prioritize = "coalesce(description("megamerge\n"), trunk())"
```
2025-03-29 13:50:55 +00:00
Daniel Luz
05c77a853f formatter: add support for reversing colors 2025-03-25 15:54:22 +00:00
Martin von Zweigbergk
108aae1d9b git: set --intent-to-add on new files
In colocated repos, we set up the Git index to make `git diff` closely
match `jj diff`. However, `git diff` will not include new files. We're
long talked about using the `git add --intent-to-add` feature to make
the match closer. This patch implements that. It does so both after
updating the working copy and after snapshotting. After updating the
working copy, the new file in the working-copy commit (compared to the
parent(s)) are marked as intent-to-add. After snapshotting, newly
snapshotted files are marked as intent-to-add, and deleted ones that
were previously marked as intent-to-add are removed from the index.

Closes #6122
2025-03-25 13:40:13 +00:00
Benjamin Tan
60ce0b87d8 cli: git: add git root command
This was discussed briefly in [1], and makes it easier to execute
scripts which require a reference to the Git directory.

[1]: https://github.com/jj-vcs/jj/discussions/5767#discussioncomment-12480764
2025-03-25 08:58:43 +00:00
Yuya Nishihara
9a615b5b62 config: relax bare string rule to accept middle apostrophes, etc.
Closes #5748
2025-03-22 09:00:44 +00:00
Caleb White
680c41c30f signing: add gpgsm backend
The adds support for PKCS#12 certificates through the `gpgsm` backend.

Closes #5856
2025-03-20 17:01:39 +00:00