Skip to content

Conversation

@ugultopu
Copy link
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 lszomoru added feature-request Request for new features or functionality git GIT issues labels Mar 27, 2023
@lszomoru lszomoru added this to the April 2023 milestone Mar 27, 2023
@ugultopu
Copy link
Contributor Author

@eamodio Would greatly appreciate any feedback if you have availability.

@lszomoru lszomoru modified the milestones: April 2023, May 2023 Apr 26, 2023
@lszomoru
Copy link
Member

@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 lszomoru closed this May 15, 2023
@lszomoru 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

2 participants