Skip to content

Add similarity threshold option to Git extension - #178266

Closed
Utku Gultopu (ugultopu) wants to merge 4 commits into
microsoft:mainfrom
ugultopu:ugultopu/add-similarity-threshold-to-git-extension
Closed

Utku Gultopu (ugultopu) wants to merge 4 commits into
microsoft:mainfrom
ugultopu:ugultopu/add-similarity-threshold-to-git-extension

Conversation

@ugultopu

Copy link
Copy Markdown
Contributor

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.txt with the following content:

1
2
3
4
5
6
7
8
9
10

Open the folder containing the Git repository in Visual Studio Code, rename test.txt to test-new.txt and modify it so that it will become:

1.
2.
3.
4.
5.
6
7
8
9
10

Stage your changes. It should show as if test.txt has been deleted and test-new.txt has 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.txt as renamed and it should show you the modifications that you have performed on test.txt.

@lszomoru Ladislau Szomoru (lszomoru) added feature-request Request for new features or functionality git GIT issues labels Mar 27, 2023
@ugultopu

Copy link
Copy Markdown
Contributor Author

Eric Amodio (@eamodio) Would greatly appreciate any feedback if you have availability.

@lszomoru

Copy link
Copy Markdown
Member

Utku Gultopu (@ugultopu), thank you very much for the contribution. I have taken your changes, made couple of small changes and committed them with #182492. I will go ahead and close this pull request, but make sure that it is being called out on our release notes.

@lszomoru Ladislau Szomoru (lszomoru) added the on-release-notes Issue/pull request mentioned in release notes label May 15, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

feature-request Request for new features or functionality git GIT issues on-release-notes Issue/pull request mentioned in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants