-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
tree merge with tree-related auto-resolution #1705
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… to indicate auto-resolution. Previously it wasn't possible to detect auto-resolution, even though it can be assumed if a resolution mode was provided.
Byron
force-pushed
the
merge
branch
2 times, most recently
from
November 25, 2024 19:45
5169947
to
2b639aa
Compare
…conflicts`. That way it's possible to steer how to resolve tree-related conflicts while making it possible to detect that a conflict happened.
Byron
force-pushed
the
merge
branch
7 times, most recently
from
December 2, 2024 15:12
c5c6512
to
a82f3f2
Compare
13 tasks
Byron
force-pushed
the
merge
branch
3 times, most recently
from
December 5, 2024 11:45
35226fc
to
ad9d484
Compare
…urs' or 'ancestor'
That way it's possible to control how tree-conflicts should be auto-resolved.
With it one can decide which side to favor in case of irreconcilable tree-conflicts.
Previously, the lock location would block all writers from executing a fixture even though they wouldn't step on each others feet. Now, a script destination is used to assure locks are created close to the destination when creating writable fixtures, typically removing the need for multiple writers to wait on each other unnecessarily.
… `Id`. This makes these types easier to use as it's enough to pass a wrapped type to perform more actions on the underlying repository.
Previously it was impossible to tell if rename tracking was disabled, or if it was unset, which leads to incorrect logic. This changes the signature of `diff::new_rewrites()` to also provide information about whether or not it was configured.
The problem here is that our implementation avoids using a hashmap, but pays the price by having bad performance if there are too many possible candidates (binary search doesn't seem to be up to the task). This can lead to impossibly long runtimes, so for now, limit it explicitly.
…ave unconflicted *and* conflicted entries. This is a massive footgun currently where incorrect usage is very likely while causing all kinds of mistakes.
Previously it was possible to mark perfectly working content merges as conflicting if we would choose 'our' or 'their' resolution.
Empty files are equivalent to having no content, which also means such files have no identity to speak off. This definitely helps with false positives of `.gitignore` for instance, which can be empty to tell Git to track a directory. On top of that, Git has a heuristic to do rename tracking of small files by similarity as the similarity may be off of files just have a couple of lines to speak about. Note that empty files that are renamed as part of a whole directory will still be tracked as renames.
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make it possible to resolve tree-conflicts with
ours
while making it possible to notice that a conflict would otherwise have occurred.The idea is that one wants to produce a suitable tree while noticing that a conflict would have occurred if we wouldn't have resolved it.
Follow-up of #1661.
Tasks
ancestor
usecase andours
is coveredours
andancestors
withA-B
andB-A
order.gix
.gix merge tree/commit
, start sharing settings inclap
as well.whatever/empty
insimple
)todo!()
anddbg!
Implementation Notes
ancestor
case, so it's not always as good as it can possibly be, fortunately in what I would call 'niche' situations. In practice, it's only used for merging virtual merge bases.merge.directoryRenames
isn't implemented, even though Git has a handle for that. We could respect the setting by deciding what should be a conflict, even though right now we always track directory renames.Possible Tasks
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.Archive
Previous Research (index creation)
record_conflicted_entries()
sets the index to match what was recorded.gitoxide
can checkout a tree as well (while keeping the index in memory).checkout()
by tree-id, with auto-updates to the index, in-memory.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
.