Skip to content

Conversation

@susiwen8
Copy link
Contributor

@susiwen8 susiwen8 commented Jan 13, 2021

This PR fixes #88369 also fixes #9475

Kapture 2021-01-13 at 21 37 35

@susiwen8
Copy link
Contributor Author

Need to update test

@susiwen8 susiwen8 marked this pull request as draft January 13, 2021 15:28
@joaomoreno joaomoreno assigned eamodio and unassigned joaomoreno Jan 14, 2021
@joaomoreno joaomoreno requested a review from alexdima January 14, 2021 09:19
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, absolutely not a good change.

For example, for a file with 1000 lines where all 1000 lines are changed by one character, this PR would allocate 1 million LineChange objects.

Looking at the issue you are trying to fix and the location where you propose code changes, I think there is a misunderstanding. The diffComputer should not be touched. The problem of intersecting a selection with a diff change needs to be solved in the git specific action that stages/unstages hunks. So the git actions need to take a linechange and "trim" it to the selected text. It should not be the diff computer (which is performance sensitive) allocate an object per changed line.

@susiwen8
Copy link
Contributor Author

Yes, that is a big issue, I'm going to close this PR.

@susiwen8 susiwen8 closed this Jan 14, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git - 'Revert selected ranges' should work on individual lines, not hunks Git: Add support for staging a subset of deleted lines

4 participants