Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
TortoiseGit
TortoiseGit
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 294
    • Issues 294
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 8
    • Merge Requests 8
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • TortoiseGit
  • TortoiseGitTortoiseGit
  • Issues
  • #3679

Closed
Open
Opened Dec 03, 2020 by Kaido Hallik@kaidohallik

DiffSimilarityIndexThreshold is not used to calculate Status in diff view

What steps will reproduce the problem?

  1. Create Git repository and commit file oldfile.txt with content:
oldline 1
oldline 2
oldline 3
  1. Rename oldfile.txt to newfile.txt and change it's content to:
oldline 1
oldline 2
newline 1
newline 2
newline 3
  1. Run git add .

  2. In TortoiseGit advanced settings set option DiffSimilarityIndexThreshold value to 30

  3. 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?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: tortoisegit/tortoisegit#3679