DiffSimilarityIndexThreshold is not used to calculate Status in diff view
What steps will reproduce the problem?
- Create Git repository and commit file
oldfile.txt
with content:
oldline 1
oldline 2
oldline 3
- Rename
oldfile.txt
tonewfile.txt
and change it's content to:
oldline 1
oldline 2
newline 1
newline 2
newline 3
-
Run
git add .
-
In TortoiseGit advanced settings set option
DiffSimilarityIndexThreshold
value to30
-
See diff with TortoiseGit, it's showing:
Path Extension Status Lines added Lines removed
newfile.txt .txt Added 3 1
oldfile.txt .txt Deleted 0 3
and it's not possible to compare old and new files (if Status is Rename then it's possible).
Seems that DiffSimilarityIndexThreshold
is used only for calculating Lines added and Lines removed, but not for calculating Status.
What is the expected output? What do you see instead?
Expected result is
Path Extension Status Lines added Lines removed
newfile.txt (from oldfile.txt) .txt Rename 3 1
and have possibility to compare old and new files (if Status is Rename then it's possible).
Similarity index is 40% according to git diff --staged -M30%
diff --git a/oldfile.txt b/newfile.txt
similarity index 40%
rename from oldfile.txt
rename to newfile.txt
index aa423f5..d15de51 100644
--- a/oldfile.txt
+++ b/newfile.txt
@@ -1,3 +1,5 @@
oldline 1
oldline 2
-oldline 3
+newline 1
+newline 2
+newline 3
What version of TortoiseGit and Git are you using? On what operating system?
- TortoiseGit version: 2.11.0.0
- Git version: git version 2.29.2.windows.2
- Operating system: Windows 10
Please provide any additional information below.
If changing newfile.txt
content to
oldline 1
oldline 2
newline 1
newline 2
then similarity index is 50% and output is
Path Extension Status Lines added Lines removed
newfile.txt (from oldfile.txt) .txt Rename 2 1
This seems to confirm that for Status calculation is used Git default 50% similarity threshold.
DiffSimilarityIndexThreshold
was requested in #3240 (closed) and as this was closed by implementation commit then it probably worked as expected in TortoiseGit version 2.6.4
Maybe meanwhile Status calculation command has changed and this new command is not using DiffSimilarityIndexThreshold
?