Add git.DIFF_RENAME_SIMILARITY_THRESHOLD option#36164
Add git.DIFF_RENAME_SIMILARITY_THRESHOLD option#36164wxiaoguang merged 10 commits intogo-gitea:mainfrom
Conversation
|
Maybe 25% is too prone to false-positive detections. Maybe I will revert to 50%, which is a safe default and I see why git has chosen it. |
|
Reverted to 50%. Ideally I think this could be a UI option, but it being a server option will suffice initially. |
TheFox0x7
left a comment
There was a problem hiding this comment.
Not sure if that's a concern given the existing issues with settings but shouldn't settings value be checked? Otherwise git will error out later at runtime
|
Hmm I guess we can add a small validation like |
|
Validation added. |
|
PS: I also checked git diff config and it appears there is no config option to alter the |
* giteaofficial/main: Add JSON linting (go-gitea#36192) Bump setup-node to v6, re-enable cache (go-gitea#36207) [skip ci] Updated translations via Crowdin Update chroma to v2.21.1 (go-gitea#36201) Disable dependabot automatic labels (go-gitea#36203) Bump astral-sh/setup-uv from 6 to 7 (go-gitea#36198) Front port changelog (go-gitea#36193) Bump dev-hanz-ops/install-gh-cli-action from 0.1.0 to 0.2.1 (go-gitea#36195) Bump aws-actions/configure-aws-credentials from 4 to 5 (go-gitea#36196) Bump docker/build-push-action from 5 to 6 (go-gitea#36197) Enable dependabot for actions (go-gitea#36191) Bump alpine to 3.23 (go-gitea#36185) Use gitRepo as parameter instead of repopath when invoking sign functions (go-gitea#36162) Fix bug when creating pull request (go-gitea#36166) Bump golangci-lint to 2.7.2, enable modernize stringsbuilder (go-gitea#36180) Use a migration test instead of a wrong test which populated the meta test repositories and fix a migration bug (go-gitea#36160) Update JS deps and eslint enhancements (go-gitea#36147) Add git.DIFF_RENAME_SIMILARITY_THRESHOLD option (go-gitea#36164) Fix OrgAssignment opts (go-gitea#36174) # Conflicts: # models/user/user.go
This makes the threshold value passed to
git diff --find-renamesconfigurable. Git's default is 50% and this sets the same value. For example, here is a file rename and change with 3 out of 4 changed lines with a value of 25%:The reason for this change is the rewrite+rename in #36118 and I checked the similarity index there, and it's only 21%, so will need a value of 20% or less: