-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
octopus-merge (part 5: tree-merge-ORT three-way) #1618
Conversation
45b3557
to
64e0f78
Compare
Per actions/runner-images#10636, the `ubuntu-latest` GitHub Actions hosted runner is being migrated from `ubuntu-22.04` to `ubuntu-24.04`. The `ci.yml` workflow, including the full `test` job, use `ubuntu-latest`, and recently has switched over to using Ubuntu 24.04 runner. It makes sense to use this newer version, but that runner apparently does not preinstall the headers required to build with `-llzma`. That causes `just ci-test` to fail at `cargo nextest run -p gix-testtools --features xz` with `/usr/bin/ld: cannot find -llzma: No such file or directory`. This installs the `liblzma-dev` package that provides the required headers, so we can use Ubuntu 24.04 LTS while continuing to test the `xz` feature of `gix-testtools`. The failure this addresses was first observed in GitoxideLabs#1618 at 64e0f78: https://github.com/GitoxideLabs/gitoxide/actions/runs/11304216949/job/31442302018?pr=1618 But it is not caused by any of the changes there, and it now occurs whenever the `test` job is run, including if it is re-run at the tip of the main branch (or any other branch), such as in: https://github.com/EliahKagan/gitoxide/actions/runs/11317510844/job/31471040361 In both cases, expanding Set up job > Operating system shows Ubuntu 24.04.1 LTS. (The failure this addresses is also not related to GitoxideLabs#1622, which documents an unrelated failure that is possible to observe locally and that, if no change is made related to it, can be expected to occur on CI in the `test` starting sometime soon, but that is not yet seen on CI.)
As detailed in #1623, which provides a fix, the failure observed here in the CI Merging #1623 and then rebasing this onto main should fix the |
Per actions/runner-images#10636, the `ubuntu-latest` GitHub Actions hosted runner label is being migrated from aliasing `ubuntu-22.04` to aliasing `ubuntu-24.04`. Our `ci.yml` workflow, which includes the full `test` job, uses `ubuntu-latest`, and recently has switched automatically to using an Ubuntu 24.04 runner. It makes sense to use this newer version, but that runner apparently does not preinstall the headers required to build with `-llzma`. That causes `just ci-test` to fail at `cargo nextest run -p gix-testtools --features xz` with `/usr/bin/ld: cannot find -llzma: No such file or directory`. This commit installs the `liblzma-dev` package that provides the required headers, so we can use Ubuntu 24.04 LTS while continuing to test the `xz` feature of `gix-testtools`. The failure this addresses was first observed in GitoxideLabs#1618 at 64e0f78: https://github.com/GitoxideLabs/gitoxide/actions/runs/11304216949/job/31442302018?pr=1618 But it is not caused by any of the changes there, and it now occurs whenever the `test` job is run, including if it is re-run at the tip of the main branch (or any other branch), such as in: https://github.com/EliahKagan/gitoxide/actions/runs/11317510844/job/31471040361 In both cases, expanding *Set up job* > *Operating system* shows Ubuntu 24.04.1 LTS. (The failure this addresses is also not related to GitoxideLabs#1622, which documents an unrelated failure that is possible to observe locally and that, if no change is made related to it, can be expected to occur on CI in the `test` starting sometime soon, but that is not yet seen on CI.)
1f75b49
to
207c35a
Compare
b1dae2b
to
0fce40d
Compare
…merge results. This works by either selecting a possibly unchanged and not even loaded resource, instead of always loading it to provide a buffer, in case the user doesn't actually want a buffer. Note that this also alters `buffer_by_pick()` to enforce handling of the 'buffer-too-large' option.
…ration This also fixes an issue with blob merge computations. It's breaking because the marker-size was reduced to `u8`.
…tial name. For instance, previously, a ref named `A` could not be found even though `refs/heads/A` existed.
There it's far more useful and plumbing crates are enabled to write objects without pulling in `gix-odb` as dependency.
2125886
to
df7a50f
Compare
…RT` as far as tests go. Note that this judgement of quality is based on a limited amount of partially complex test, but it's likely that in practice there will be deviations of sorts. Also, given the complexity of the implementation it is definitely under-tested, but with that it's mostly en par with Git, unfortunatly. On the bright side, some of the tests are very taxing and I'd hope this means something for real-world quality.
…writing. That way it becomes usable when merging trees, which benefits from automatic checking of hashes before writing loose objects.
Since GitoxideLabs#1618, which introduced `gix-merge::merge tree::run_baseline` and the functionality it tests, that test has failed on Windows when run with `GIX_TEST_IGNORE_ARCHIVES=1`. This happens because, while `chmod +x` commands run and exit indicating success in MSYS environments such as Git Bash, they do not actually make a change. Multiple cases (all sub-cases of the same faililing test) would fail this way. But the test fails fast, so only one is reported. The first to fail this way is `same-rename-different-mode`, which shows: --- STDERR: gix-merge::merge tree::run_baseline --- failed to extract 'tests\fixtures\generated-archives\tree-baseline.tar': Ignoring archive at 'tests\fixtures\generated-archives\tree-baseline.tar' as GIX_TEST_IGNORE_ARCHIVES is set. thread 'tree::run_baseline' panicked at gix-merge\tests\merge\tree\mod.rs:83:21: assertion `left != right` failed: same-rename-different-mode-A-B-reversed: Git caught up - adjust expectation Git works for the A/B case, but for B/A it forgets to set the executable bit left: Sha1(d75339daa64f3a1d98947623eee7bbb218e6c87d) right: Sha1(d75339daa64f3a1d98947623eee7bbb218e6c87d) This commit fixes that by using `git update-index --chmod=+x` to stage the intended effect of `chmod +x`. The `chmod +x` commands are still run, to avoid non-intended and potentially bug-prone or confusing differences between the metadata on disk and what is staged and commited, on systems where Unix-style permissions are supported on disk and `chmod +x` modifies them. Although only one of the two approaches is needed on any particular system in these tests, deciding based on the operating system is more complicated. It would also be misleading, because the effect of the two kinds of commands is not, in *general*, the same: one operates on files in the working tree, and the other operates on the index. Therefore, both are used, for simplicity and clarity. For readability, adjacent `chmod +x` commands are also combined into one. This way, each place that has both `chmod +x` logic and `git update-index --chmod=+x` logic can have a single command for each, that clearly relate to each other. As noted above, the change in this commit is not sufficient to fix that failing test, because a subsequent assertion still fails. This will be detailed and fixed in a subsequent commit. (This commit also does not yet update generated archives.)
Three-way merging of trees.
Follow-up of #1612.
Tasks
tree::Editor::get()
to find unique path namesmulti-tree traversal (without wildcard support!)- for now, let's just do it 'the simple' way and perform two diffsmerge
attributediff3-conflict-markers
diff3-conflict-markers.sh
- be sure to capture the 'empty tree' label , but also other special caseshave motivating tests to put- not feasible for now, let's get this merged and tested in the real worldpossibly_rewritten_location()
into all the right placestest- it's not in merge-ORT so let's skip thatcopy
versions of rewritessee if- they are neededremove_existing_leaf()
calls are necessaryRepository::merge_trees
gix merge tree
implementation, based on commits. Maybe create something to easily merge multiple commits while at it (ingix
).Next PR / Outscoped
Repository::merge_commits()
gix merge commit
gix
API - for now all plumbing options and return values are exposed.libgit2
also doesn't try it.textconv
with context, see this gist for details.GIT_DIR
set, others do.gix-command::Context
.Make blob-merge based conflict handling possible in the tree merge from- not needed for nowgix
at least.Research
Everything is about MergeORT.
ability to re-use object caches of a repo that has seen the base-tree already, but overall, who knows*
-X ours
for instance don't affect tree-related auto-resolutions, just the ones related to content. This could be implemented when there is demand though.merge-ORT
cannot properly handle renames within renamed directories, ending up with the source of the subdir-rename still present.git2::MergeOptions
.