Accurately calculate number of conflicted files in a merge#19626
Merged
niik merged 11 commits intodevelopmentfrom Dec 9, 2024
Merged
Accurately calculate number of conflicted files in a merge#19626niik merged 11 commits intodevelopmentfrom
niik merged 11 commits intodevelopmentfrom
Conversation
tidy-dev
approved these changes
Dec 5, 2024
Contributor
tidy-dev
left a comment
There was a problem hiding this comment.
🔥 This appears to work as expected (and faster) and makes sense.
This file contains hidden or 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
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.
Closes #8049
Description
Here's little bonus PR at the tail end of the Git large output work. I've been eyeing our
determineMergeabilityfunction because it's the only remaining function which usesspawnGit. I was pleasantly surprised to find that in the time that's passed since we initially wrotedetermineMergeabilitythere's been some great improvements togit-merge-tree.Most importantly that it's able to perform "real merges" (
--write-tree), i.e. the exact same merge that would occur if you rangit mergein the terminal except that it won't touch the index or the working directory. This is what we've been looking for to resolve #8049.The merge will be done in memory and the resulting tree will be written to disk but unless a merge occurs it will be dangling and cleaned up on the next garbage collection.
And thanks to
--name-onlyand-zwe can get rid of all logic to parse diffs looking for conflicts markers and let Git do the work for us 🎉I also removed our
promiseWithTimeout"hack" and added an asynchronous cache (adding thep-memoizationlibrary instead of rolling our own) which will ensure we don't have to recalculate the merge tree when the user clicks around in the merge dialog.Screenshots
Release notes
Notes: