Add similarity threshold option to Git extension #178266
Closed
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.
This pull request implements the feature requested in #178265. Basically, it gives the user an option to configure the similarity threshold in Git, so that even big modifications on a renamed file would correctly show as modifications on a renamed file, instead of being shown as the original file being deleted and a completely new file being added, which makes it very difficult to understand what exactly has been modified.
To test the changes, create a Git repository and create a commit containing a file named
test.txtwith the following content:Open the folder containing the Git repository in Visual Studio Code, rename
test.txttotest-new.txtand modify it so that it will become:Stage your changes. It should show as if
test.txthas been deleted andtest-new.txthas been added.Now, open Visual Studio Code settings, navigate to Extensions -> Git, find the setting named "Similarity Threshold" and set it to 40. Refresh the Source Control view by clicking on the refresh button on it. Now, Source Control view should correctly show
test-new.txtas renamed and it should show you the modifications that you have performed ontest.txt.