Skip to content

repo.references() fails to deduplicate packed/loose refs #1928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yuja opened this issue Apr 5, 2025 · 12 comments · Fixed by #1931
Closed

repo.references() fails to deduplicate packed/loose refs #1928

yuja opened this issue Apr 5, 2025 · 12 comments · Fixed by #1931
Assignees
Labels
acknowledged an issue is accepted as shortcoming to be fixed

Comments

@yuja
Copy link
Contributor

yuja commented Apr 5, 2025

Current behavior 😯

With the following setup, repo.references() emits both loose and packed refs.

git init -q

mkdir -p .git/refs/heads/a
echo 4b825dc642cb6eb9a060e54bf8d69288fbee4904 > .git/refs/heads/a-
echo 4b825dc642cb6eb9a060e54bf8d69288fbee4904 > .git/refs/heads/a/b
echo 4b825dc642cb6eb9a060e54bf8d69288fbee4904 > .git/refs/heads/a0
git pack-refs --all

This generates the following packed-refs:

# pack-refs with: peeled fully-peeled sorted
4b825dc642cb6eb9a060e54bf8d69288fbee4904 refs/heads/a-
4b825dc642cb6eb9a060e54bf8d69288fbee4904 refs/heads/a/b
4b825dc642cb6eb9a060e54bf8d69288fbee4904 refs/heads/a0
EOF

Create loose refs:

mkdir -p .git/refs/heads/a
echo 0000000000000000000000000000000000000000 > .git/refs/heads/a-
echo 0000000000000000000000000000000000000000 > .git/refs/heads/a/b
echo 0000000000000000000000000000000000000000 > .git/refs/heads/a0

List all refs:

fn main() {
    let path = env::args().nth(1).unwrap();
    let repo = gix::open(path).unwrap();
    for git_ref in repo.references().unwrap().all().unwrap() {
        let git_ref = git_ref.unwrap();
        println!("{} {:?}", git_ref.name().as_bstr(), git_ref.target());
    }
}

refs/heads/a/b in packed-refs should be omitted:

refs/heads/a- Object(Sha1(0000000000000000000000000000000000000000))
refs/heads/a/b Object(Sha1(4b825dc642cb6eb9a060e54bf8d69288fbee4904))
refs/heads/a0 Object(Sha1(0000000000000000000000000000000000000000))
refs/heads/a/b Object(Sha1(0000000000000000000000000000000000000000))

I think this is regression caused by the fix for #1850. Maybe we'll need to sort file-system entries in the same way as tree::EntryRef?

Expected behavior 🤔

No response

Git behavior

No response

Steps to reproduce 🕹

No response

@Byron Byron self-assigned this Apr 5, 2025
@Byron Byron added the acknowledged an issue is accepted as shortcoming to be fixed label Apr 5, 2025
@Byron
Copy link
Member

Byron commented Apr 5, 2025

Thanks a lot for reporting and for figuring out a reproduction.

It's going to go into the test-suite, from where I'd hope to be able to develop a patch. I perfectly agree that it's related to sorting.

Since you went so far, I wouldn't want to be in your way of submitting a PR with a reproduction test-case, maybe you want to take a shot at figuring out the sorting as well?
It will probably take me a couple of days.

@yuja
Copy link
Contributor Author

yuja commented Apr 5, 2025

Sure, I'll take a look. Is it okay to add gix-features -> gix-path dependency? We'll probably need to convert OsStr to BStr.

@Byron
Copy link
Member

Byron commented Apr 5, 2025

Thank you! And absolutely, do what you must.

yuja added a commit to yuja/gitoxide that referenced this issue Apr 5, 2025
…GitoxideLabs#1928)

This follows up 7b1b5bf. Since packed-refs
appears to be sorted by full ref name, loose-refs should also be emitted in
that order.

The comparison function is copied from gix::diff::object::tree::EntryRef.
Non-utf8 file names are simply mapped to "" on Windows. We could add some
fallback, but callers can't handle such file names anyway.
yuja added a commit to yuja/gitoxide that referenced this issue Apr 5, 2025
…GitoxideLabs#1928)

This follows up 7b1b5bf. Since packed-refs
appears to be sorted by full ref name, loose-refs should also be emitted in
that order.

The comparison function is copied from gix::diff::object::tree::EntryRef.
Non-utf8 file names are simply mapped to "" on Windows. We could add some
fallback, but callers can't handle such file names anyway.
@ilyagr
Copy link

ilyagr commented Apr 6, 2025

Meanwhile, with gix 0.71, I'm getting a similar problem to #1850 , but for remote references instead of local references this time. How do I check whether this is the same as the issue that Yuya found?

$ bat src/main.rs
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
File: src/main.rs
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
use std::path::Path;

use gix::bstr::{B, BString, ByteSlice};

fn main() -> anyhow::Result<()> {
    let repo = gix::discover(Path::new(
        "/Users/ilyagr/dev/jj",
    ))?;
    for b in repo.references()?.remote_branches()? {
        let b = b.unwrap();
        if b.name().as_bstr().find(b"squash-preserve").is_some() {
            dbg!(b);
        }
    }
    Ok(())
}
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ cargo run
[src/main.rs:12:13] b = Reference {
    name: FullName(
        "refs/remotes/upstream/ig/squash-preserve-snapshot",
    ),
    target: Object(
        Sha1(cbf363db4b7036e736660218edb099ce8dfda99c),
    ),
    peeled: None,
}
[src/main.rs:12:13] b = Reference {
    name: FullName(
        "refs/remotes/upstream/ig/squash-preserve-snapshot",
    ),
    target: Object(
        Sha1(389858b237528e259d9d81c1353fe5fd4dd5baa8),
    ),
    peeled: None,
}

The program that I copied above is almost identical to before:

diff --git a/src/main.rs b/src/main.rs
index 6a4aba9403..b67638212e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,17 +1,14 @@
 use std::path::Path;

-use gix::{
-    bstr::{B, BString, ByteSlice},
-    date::time::format,
-    revision::walk::Sorting,
-};
+use gix::bstr::{B, BString, ByteSlice};

 fn main() -> anyhow::Result<()> {
-    let repo = gix::discover(Path::new("/Users/ilyagr/dev/jj"))?;
-    for b in repo.references()?.local_branches()? {
+    let repo = gix::discover(Path::new(
+        "/Users/ilyagr/dev/jj",
+    ))?;
+    for b in repo.references()?.remote_branches()? {
         let b = b.unwrap();
-        let pat: Vec<u8> = B("pr4021").into();
-        if b.name().as_bstr().find(pat.as_slice()).is_some() {
+        if b.name().as_bstr().find(b"squash-preserve").is_some() {
             dbg!(b);
         }
     }

@yuja
Copy link
Contributor Author

yuja commented Apr 6, 2025

Meanwhile, with gix 0.71, I'm getting a similar problem to #1850 , but for remote references instead of local references this time. How do I check whether this is the same as the issue that Yuya found?

Can you test with #1931 applied? The current git::import_refs() in jj is pretty much broken.

@ilyagr
Copy link

ilyagr commented Apr 6, 2025

#1931 fixes it! Awesome! 🎉 🎉

BTW, unsurprisingly, running git gc or jj util gc --expire now is still a working workaround.

To be more precise, I did

diff --git a/Cargo.toml b/Cargo.toml
index 38f0489907..1f7c18f9cc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,3 +7,5 @@
 anyhow = "1.0.96"
 gix = "0.71.0"

+[patch.crates-io]
+gix = { git = "https://github.com/yuja/gitoxide", branch = "push-klrqpplwxrkx" }

I guess the same would work for jj (for people who are willing to compile it from source).

Byron pushed a commit to yuja/gitoxide that referenced this issue Apr 6, 2025
…itoxideLabs#1928)

This follows up 7b1b5bf. Since packed-refs
appears to be sorted by full ref name, loose-refs should also be emitted in
that order.

The comparison function is copied from gix::diff::object::tree::EntryRef.
Non-utf8 file names are simply mapped to "" on Windows. We could add some
fallback, but callers can't handle such file names anyway.
Byron added a commit that referenced this issue Apr 6, 2025
make `fs::walkdir_sorted_new()` sort entries by paths literally (#1928)
@moroten
Copy link
Contributor

moroten commented Apr 6, 2025

I have tested with gix=0.68.0 and overriding with gix-features=0.41.1 and I still get refs reported that are not part of repo.references()?.prefixed(...) scope. The refs that are reported are loose refs which are not present in .git/packed-refs.

@Byron
Copy link
Member

Byron commented Apr 6, 2025

I don't know if that really works, gix should be at 0.71 to actually pick up the gix-features override.
However, if the issue still persists, please open a new issue with a reproduction.
Thank you.

@moroten
Copy link
Contributor

moroten commented Apr 6, 2025

Still the same problem with gix=0.71.0 overridden with gix-features=0.41.1 (1612c73).

yuja added a commit to yuja/jj that referenced this issue Apr 6, 2025
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.

GitoxideLabs/gitoxide#1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
github-merge-queue bot pushed a commit to jj-vcs/jj that referenced this issue Apr 6, 2025
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.

GitoxideLabs/gitoxide#1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
pierrechevalier83 pushed a commit to pierrechevalier83/gitoxide that referenced this issue Apr 6, 2025
pierrechevalier83 pushed a commit to pierrechevalier83/gitoxide that referenced this issue Apr 6, 2025
…itoxideLabs#1928)

This follows up 7b1b5bf. Since packed-refs
appears to be sorted by full ref name, loose-refs should also be emitted in
that order.

The comparison function is copied from gix::diff::object::tree::EntryRef.
Non-utf8 file names are simply mapped to "" on Windows. We could add some
fallback, but callers can't handle such file names anyway.
@ilyagr
Copy link

ilyagr commented Apr 6, 2025

It might help if @Byron could release gix 0.71.1 that depends on the new patch version.

I'm not sure this is a real issue, nor whether there's an easier solution, but we're thinking of making a patch release of jj for this bug. I'm worried that if jj only list the new gix-features release in its Cargo.lock (since it's an indirect dependency), it might not propagate to other people packaging jj or even cargo install jj-cli.

@Byron
Copy link
Member

Byron commented Apr 7, 2025

Cargo will auto-upgrade to the latest available gix-features upon installation and thus should pick up all released fixes. Feature flags aren't involved, and I don't think this fix can be suppressed or somehow not come through.
Maybe I am missing something though. I tested this, and it picks up [email protected] as one would expect.

I think if jj really wants to make sure, they could add gix-features as dummy-dependency in the latest version, and then create a patch release.
That dummy could be removed immediately after the release is done.

yuja added a commit to yuja/jj that referenced this issue Apr 7, 2025
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.

GitoxideLabs/gitoxide#1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
martinvonz pushed a commit to jj-vcs/jj that referenced this issue Apr 7, 2025
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.

GitoxideLabs/gitoxide#1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
@ilyagr
Copy link

ilyagr commented Apr 7, 2025

I think if jj really wants to make sure, they could add gix-features as dummy-dependency in the latest version, and then create a patch release.
That dummy could be removed immediately after the release is done.

That's good advice, thanks!

kejadlen pushed a commit to kejadlen/jj that referenced this issue Apr 16, 2025
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.

GitoxideLabs/gitoxide#1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
kejadlen pushed a commit to kejadlen/jj that referenced this issue Apr 16, 2025
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.

GitoxideLabs/gitoxide#1928

The Zlib license is added to the allow list because foldhash appears in the
dependency chain.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Apr 20, 2025
## [0.28.2] - 2025-04-07

### Fixed bugs

* Fixed problem that old commits could be re-imported from Git.
  GitoxideLabs/gitoxide#1928
tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue May 10, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [martinvonz/jj](https://github.com/martinvonz/jj) | minor | `v0.27.0` -> `v0.29.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>martinvonz/jj (martinvonz/jj)</summary>

### [`v0.29.0`](https://github.com/jj-vcs/jj/releases/tag/v0.29.0)

[Compare Source](jj-vcs/jj@v0.28.2...v0.29.0)

##### About

jj is a Git-compatible version control system that is both simple and powerful. See the [installation instructions](https://jj-vcs.github.io/jj/v0.29.0/install-and-setup/) to get started.

##### Release highlights

-   Experimental support for transferring the change ID to/from Git remotes behind configuration
    setting `git.write-change-id-header`. If this is enabled, the change ID will be stored in the Git
    commit itself (in a commit header called `change-id`), which means it will be transferred by
    regular `git push` etc. This is an evolving feature that currently defaults to "false". This
    default will likely change in the future as we gain confidence with forge support and user
    expectations.

##### Breaking changes

-   `jj git push -c`/`--change` no longer moves existing local bookmarks.

-   The `editor-*.jjdescription` files passed to your editor by e.g. `jj describe`
    are now written to your system's temporary directory instead of `.jj/repo/`.

##### Deprecations

-   `git.subprocess = false` has been deprecated, and the old `libgit2`
    code path for fetches and pushes will be removed entirely in 0.30.
    Please report any remaining issues you have with the Git
    subprocessing path.

-   `ui.default-description` has been deprecated, and will be migrated to
    `template-aliases.default_commit_description`. Please also consider using
    [`templates.draft_commit_description`](docs/config.md#default-description),
    and/or [`templates.commit_trailers`](docs/config.md#commit-trailers).

-   On macOS, config.toml files in `~/Library/Application Support/jj` are
    deprecated; one should instead use `$XDG_CONFIG_HOME/jj`
    (defaults to `~/.config/jj`)

##### New features

-   Color-words diff has gained [an option to compare conflict pairs without
    materializing](docs/config.md#color-words-diff-options).

-   `jj show` patches can now be suppressed with `--no-patch`.

-   Added `ui.bookmark-list-sort-keys` setting to configure default sort keys for the
    `jj bookmark list` command.

-   New `signed` revset function to filter for cryptographically signed commits.

-   `jj describe`, `jj commit`, `jj new`, `jj squash` and `jj split` add the
    commit trailers, configured in the `commit_trailers` template, to the commit
    description. Use cases include DCO Sign Off and Gerrit Change Id.

-   Added `duplicate_description` template, which allows [customizing the descriptions
    of the commits `jj duplicate` creates](docs/config.md#duplicate-commit-description).

-   `jj absorb` can now squash a deleted file if it was added by one of the
    destination revisions.

-   Added `ui.streampager.show-ruler` setting to configure whether the ruler should be
    shown when the builtin pager starts up.

-   `jj git fetch` now warns instead of erroring for unknown `git.fetch` remotes
    if other remotes are available.

-   Commit objects in templates now have `trailers() -> List<Trailer>`, the Trailer
    objects have `key() -> String` and `value() -> String`.

-   `jj config edit` will now roll back to previous version if a syntax error has been introduced in the new config.

-   When using dynamic command-line completion, revision names will be completed
    in more complex expressions. For example, typing
    `jj log -r first-bookmark..sec` and then pressing Tab could complete the
    expression to `first-bookmark..second-bookmark`.

##### Fixed bugs

-   Fixed crash on change-delete conflict resolution. [#&#8203;6250](jj-vcs/jj#6250)

-   The builtin diff editor now tries to preserve unresolved conflicts. [#&#8203;4963](jj-vcs/jj#4963)

-   Fixed bash and zsh shell completion when completing aliases of multiple arguments. [#&#8203;5377](jj-vcs/jj#5377)

##### Packaging changes

-   Jujutsu now uses [`zlib-rs`](https://github.com/trifectatechfoundation/zlib-rs), a fast compression library written in Rust. Packagers should remove any dependency on CMake and drop the `packaging` Cargo feature.

##### Contributors

Thanks to the people who made this release happen!

-   Aleksey Kuznetsov ([@&#8203;zummenix](https://github.com/zummenix))
-   Austin Seipp ([@&#8203;thoughtpolice](https://github.com/thoughtpolice))
-   Benjamin Brittain ([@&#8203;benbrittain](https://github.com/benbrittain))
-   Benjamin Tan ([@&#8203;bnjmnt4n](https://github.com/bnjmnt4n))
-   Caleb White ([@&#8203;calebdw](https://github.com/calebdw))
-   Daniel Luz ([@&#8203;mernen](https://github.com/mernen))
-   Emily ([@&#8203;emilazy](https://github.com/emilazy))
-   Emily ([@&#8203;neongreen](https://github.com/neongreen))
-   Gaëtan Lehmann ([@&#8203;glehmann](https://github.com/glehmann))
-   George Christou ([@&#8203;gechr](https://github.com/gechr))
-   Ilya Grigoriev ([@&#8203;ilyagr](https://github.com/ilyagr))
-   Jacob Hayes ([@&#8203;JacobHayes](https://github.com/JacobHayes))
-   Jonas Greitemann ([@&#8203;jgreitemann](https://github.com/jgreitemann))
-   Josh Steadmon ([@&#8203;steadmon](https://github.com/steadmon))
-   Martin von Zweigbergk ([@&#8203;martinvonz](https://github.com/martinvonz))
-   Mateus Auler ([@&#8203;mateusauler](https://github.com/mateusauler))
-   Nicole Patricia Mazzuca ([@&#8203;strega-nil](https://github.com/strega-nil))
-   Nils Koch ([@&#8203;nilskch](https://github.com/nilskch))
-   Philip Metzger ([@&#8203;PhilipMetzger](https://github.com/PhilipMetzger))
-   Remo Senekowitsch ([@&#8203;senekor](https://github.com/senekor))
-   Sam ([@&#8203;Samasaur1](https://github.com/Samasaur1))
-   Steve Fink ([@&#8203;hotsphink](https://github.com/hotsphink))
-   Théo Daron ([@&#8203;tdaron](https://github.com/tdaron))
-   TimerErTim ([@&#8203;TimerErTim](https://github.com/TimerErTim))
-   Vincent Ging Ho Yim ([@&#8203;cenviity](https://github.com/cenviity))
-   Winter ([@&#8203;winterqt](https://github.com/winterqt))
-   Yuya Nishihara ([@&#8203;yuja](https://github.com/yuja))

### [`v0.28.2`](https://github.com/jj-vcs/jj/releases/tag/v0.28.2)

[Compare Source](jj-vcs/jj@v0.28.1...v0.28.2)

##### Fixed bugs

-   Fixed problem that old commits could be re-imported from Git.
    GitoxideLabs/gitoxide#1928

### [`v0.28.1`](https://github.com/jj-vcs/jj/releases/tag/v0.28.1)

[Compare Source](jj-vcs/jj@v0.28.0...v0.28.1)

> \[!NOTE]\
> Also see the [v0.28.0 release notes](https://github.com/jj-vcs/jj/releases/tag/v0.28.0).

##### About

jj is a Git-compatible version control system that is both simple and powerful. See the [installation instructions](https://jj-vcs.github.io/jj/v0.28.0/install-and-setup/) to get started.

##### Security fixes

-   Fixed SHA-1 collision attacks not being detected.
    ([GHSA-794x-2rpg-rfgr](GHSA-794x-2rpg-rfgr))

##### Fixed bugs

-   Resolved some potential build issues for packagers.
    [#&#8203;6232](jj-vcs/jj#6232)

-   Fix a bug with `:ours` and `:theirs` merge tools involving conflicted trees
    with more than two sides. [#&#8203;6227](jj-vcs/jj#6227)

##### Contributors

Thanks to the people who made this release happen!

-   Emily ([@&#8203;emilazy](https://github.com/emilazy))
-   Ilya Grigoriev ([@&#8203;ilyagr](https://github.com/ilyagr))
-   Nicole Patricia Mazzuca ([@&#8203;strega-nil](https://github.com/strega-nil))
-   Scott Taylor ([@&#8203;scott2000](https://github.com/scott2000))
-   Yuya Nishihara ([@&#8203;yuja](https://github.com/yuja))

### [`v0.28.0`](https://github.com/jj-vcs/jj/releases/tag/v0.28.0)

[Compare Source](jj-vcs/jj@v0.27.0...v0.28.0)

> \[!IMPORTANT]
> v0.28.0 was yanked from https://crates.io and superseded by [v0.28.1](https://github.com/jj-vcs/jj/releases/tag/v0.28.1).

##### About

jj is a Git-compatible version control system that is both simple and powerful. See the [installation instructions](https://jj-vcs.github.io/jj/v0.28.0/install-and-setup/) to get started.

##### Release highlights

-   jj's configuration can now be split into multiple files more easily.

-   `jj resolve` now accepts built-in tools `:ours` and `:theirs`.

-   In colocated repos, newly-created files will now appear in `git diff`.

-   A long-standing bug relating to empty files in the built-in diff editor was
    fixed. [#&#8203;3702](jj-vcs/jj#3702)

##### Breaking changes

-   The minimum supported Rust version (MSRV) is now 1.84.0.

-   The `git.push-branch-prefix` config has been removed in favor of
    `git.push-bookmark-prefix`.

-   `jj abandon` no longer supports `--summary` to suppress the list of abandoned
    commits. The list won't show more than 10 commits to not clutter the console.

-   `jj unsquash` has been removed in favor of `jj squash` and
    `jj diffedit --restore-descendants`.

-   The `jj untrack` subcommand has been removed in favor of `jj file untrack`.

-   The following deprecated revset functions have been removed:
    -   `branches()`, `remote_branches()`, `tracked_remote_branches()`, and
        `untracked_remote_branches()`, which were renamed to "bookmarks".
    -   `file()` and `conflict()`, which were renamed to plural forms.
    -   `files(x, y, ..)` with multiple patterns. Use `files(x|y|..)` instead.

-   The following deprecated template functions have been removed:
    -   `branches()`, `local_branches()`, and `remote_branches()`, which were
        renamed to "bookmarks".

-   The flags `--all` and `--tracked` on `jj git push` by themself do not cause
    deleted bookmarks to be pushed anymore, as an additional safety measure. They
    can now be combined with `--deleted` instead.

##### Deprecations

-   `core.watchman.register_snapshot_trigger` has been renamed to `core.watchman.register-snapshot-trigger` for consistency with other configuration options.

-   `jj backout` is deprecated in favor of `jj revert`.

##### New features

-   `jj sign` can now sign with [PKCS#12](https://github.com/PKCS/jj/issues/12) certificates through the `gpgsm` backend.

-   `jj sign` will automatically use the gpg key associated with the author's email
    in the absence of a `signing.key` configuration.

-   Multiple user configs are now supported and are loaded in the following precedence order:
    -   `$HOME/.jjconfig.toml`
    -   `$XDG_CONFIG_HOME/jj/config.toml`
    -   `$XDG_CONFIG_HOME/jj/conf.d/*.toml`

-   The `JJ_CONFIG` environment variable can now contain multiple paths separated
    by a colon (or semicolon on Windows).

-   The command `jj config list` now supports showing the origin of each variable
    via the `builtin_config_list_detailed` template.

-   `jj config {edit,set,unset}` now prompt when multiple config files are found.

-   `jj diff -r` now allows multiple revisions (as long as there are no gaps in
    the revset), such as `jj diff -r 'mutable()'`.

-   `jj git push` now accepts a `--named NAME=REVISION` argument to create a named
    bookmark and immediately push it.

-   The 'how to resolve conflicts' hint that is shown when conflicts appear can
    be hidden by setting `hints.resolving-conflicts = false`.

-   `jj op diff` and `jj op log --op-diff` now show changes to which commits
    correspond to working copies.

-   `jj op log -d` is now an alias for `jj op log --op-diff`.

-   `jj bookmark move --to/--from` can now be abbreviated to `jj bookmark move -t/-f`

-   `jj bookmark list` now supports `--sort` option. Similar to `git branch --sort`.
    See `jj bookmark list --help` for more details.

-   A new command `jj revert` is added, which is similar to `jj backout` but
    adds the `--destination`, `--insert-after`, and `--insert-before` options to
    customize the location of reverted commits.

-   A new command `jj git root` is added, which prints the location of the Git
    directory of a repository using the Git backend.

-   In colocated repos, any files that jj considers added in the working copy will
    now show up in `git diff` (as if you had run `git add --intent-to-add` on
    them).

-   Reversing colors is now supported. For example, to highlight words by
    reversing colors rather than underlining, you can set
    `colors."diff token"={ underline = false, reverse = true }` in your config.

-   Added `revsets.log-graph-prioritize`, which can be used to configure
    which branch in the `jj log` graph is displayed on the left instead of `@`
    (e.g. `coalesce(description("megamerge\n"), trunk())`)

-   `jj resolve` now accepts new built-in merge tools `:ours` and `:theirs`.
    These merge tools accept side [#&#8203;1](jj-vcs/jj#1) and side [#&#8203;2](jj-vcs/jj#2) of the conflict respectively.

##### Fixed bugs

-   `jj log -p --stat` now shows diff stats as well as the default color-words/git
    diff output. [#&#8203;5986](jj-vcs/jj#5986)

-   The built-in diff editor now correctly handles deleted files.
    [#&#8203;3702](jj-vcs/jj#3702)

-   The built-in diff editor now correctly retains the executable bit on newly
    added files when splitting. [#&#8203;3846](jj-vcs/jj#3846)

-   `jj config set`/`--config` value parsing rule is relaxed in a way that
    unquoted apostrophes are allowed.
    [#&#8203;5748](jj-vcs/jj#5748)

-   `jj fix` could previously create new conflicts when a descendant of a fixed
    revision was already correctly formatted.

##### Contributors

Thanks to the people who made this release happen!

-   Aleksey Kuznetsov ([@&#8203;zummenix](https://github.com/zummenix))
-   Anton Älgmyr ([@&#8203;algmyr](https://github.com/algmyr))
-   Austin Seipp ([@&#8203;thoughtpolice](https://github.com/thoughtpolice))
-   Baltasar Dinis ([@&#8203;bsdinis](https://github.com/bsdinis))
-   Benjamin Tan ([@&#8203;bnjmnt4n](https://github.com/bnjmnt4n))
-   Brandon Hall ([@&#8203;tenkabuto](https://github.com/tenkabuto))
-   Caleb White ([@&#8203;calebdw](https://github.com/calebdw))
-   Daniel Luz ([@&#8203;mernen](https://github.com/mernen))
-   David Rieber ([@&#8203;drieber](https://github.com/drieber))
-   demize ([@&#8203;demize](https://github.com/demize))
-   Emily ([@&#8203;emilazy](https://github.com/emilazy))
-   Evan Mesterhazy ([@&#8203;emesterhazy](https://github.com/emesterhazy))
-   Fedor Sheremetyev ([@&#8203;sheremetyev](https://github.com/sheremetyev))
-   George Christou ([@&#8203;gechr](https://github.com/gechr))
-   Ilya Grigoriev ([@&#8203;ilyagr](https://github.com/ilyagr))
-   Jakob Hellermann ([@&#8203;jakobhellermann](https://github.com/jakobhellermann))
-   Jo Liss ([@&#8203;joliss](https://github.com/joliss))
-   Joachim Desroches ([@&#8203;jedesroches](https://github.com/jedesroches))
-   Johannes Altmanninger ([@&#8203;krobelus](https://github.com/krobelus))
-   Jonathan Gilchrist ([@&#8203;jgilchrist](https://github.com/jgilchrist))
-   Kenyon Ralph ([@&#8203;kenyon](https://github.com/kenyon))
-   Lucas Garron ([@&#8203;lgarron](https://github.com/lgarron))
-   Martin von Zweigbergk ([@&#8203;martinvonz](https://github.com/martinvonz))
-   Nick Pupko ([@&#8203;npupko](https://github.com/npupko))
-   Philip Metzger ([@&#8203;PhilipMetzger](https://github.com/PhilipMetzger))
-   Raphael Borun Das Gupta ([@&#8203;das-g](https://github.com/das-g))
-   Remo Senekowitsch ([@&#8203;senekor](https://github.com/senekor))
-   Robin Stocker ([@&#8203;robinst](https://github.com/robinst))
-   Scott Taylor ([@&#8203;scott2000](https://github.com/scott2000))
-   Siva Mahadevan ([@&#8203;svmhdvn](https://github.com/svmhdvn))
-   Vincent Ging Ho Yim ([@&#8203;cenviity](https://github.com/cenviity))
-   Yuya Nishihara ([@&#8203;yuja](https://github.com/yuja))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4xMS4yIiwidXBkYXRlZEluVmVyIjoiNDAuMTEuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants