Skip to content
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

Smarter merge conflict resolution #19

Merged
merged 8 commits into from
Aug 5, 2023
Merged

Smarter merge conflict resolution #19

merged 8 commits into from
Aug 5, 2023

Conversation

martincostello
Copy link
Owner

  • Support resolving conflicts when the number of lines on each side of the diff is uneven, such as when a line is added or deleted.
  • Fix bug where if there was two different dependencies on the same line of a conflict, the one with the highest value would be chosen and the lower value would be incorrectly removed.
  • Refactor ActionFixture to support using it to test/debug rebasing an existing repository manually.

Support resolving conflicts when the number of lines on each side of the diff is uneven.
Add a test case for when a dependency is deleted.
Fix handling in the case where a new dependency is added.
Refactor ActionFixture to support using it to test/debug rebasing an existing repository manually.
- Fix the unresolvable conflict test so it is indeed unresolvable now.
- Fix bug where if there was two different dependencies on the same line of a conflict, the one with the highest value would be chosen and the lower value would be accidentally removed.
Read the lines out of the array once rather than possibly twice.
@martincostello martincostello added bug Something isn't working enhancement New feature or request labels Aug 5, 2023
@martincostello martincostello added this to the v1.0.2 milestone Aug 5, 2023
@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Patch coverage: 85.48% and project coverage change: -0.46% ⚠️

Comparison is base (00fab5e) 82.14% compared to head (318abc9) 81.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
- Coverage   82.14%   81.68%   -0.46%     
==========================================
  Files           5        5              
  Lines         224      273      +49     
  Branches       59       73      +14     
==========================================
+ Hits          184      223      +39     
- Misses         31       38       +7     
- Partials        9       12       +3     
Flag Coverage Δ
linux 81.68% <85.48%> (-0.46%) ⬇️
macos 81.68% <85.48%> (-0.46%) ⬇️
windows 81.68% <85.48%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/VersionParser.ts 80.55% <75.00%> (-0.70%) ⬇️
src/Resolver.ts 86.27% <87.03%> (-4.96%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- Fetch the PackageVersion or PackageReference once.
- Only get the name if the version was parsed.
If a line isn't a dependency, only take the line if it matches the line at the same index on the other side of the conflict.
@martincostello martincostello marked this pull request as ready for review August 5, 2023 15:25
@martincostello martincostello merged commit 75e1e92 into main Aug 5, 2023
9 of 10 checks passed
@martincostello martincostello deleted the smarter-merge branch August 5, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant