-
-
Couldn't load subscription status.
- Fork 2.3k
Description
Is your feature request related to a problem? Please describe.
I am in the middle of migrating a medium sized project to TypeScript from JavaScript, so I'm constantly renaming files from .js extensions to .ts while adding type annotations to them. In some cases this changes the files so much that git considers it as deletion and an addition instead of a rename, which makes reading the diff quite difficult. I find myself using this otherwise very convenient program less and less, and moving to the command line, where I can pass the --find-renames (or -M) flag to set the similarity threshold manually.
Describe the solution you'd like
A mechanism similar to the already existing whitespace display toggling in diffs, but for setting the similarity threshold required for two files to be considered the same. I don't think that this needs to be exposed on the UI like ctrl+w, it could be just a setting in the config file. (e.g. git.diff.renameThreshold)
(While we're at it, git.diffContextSize could become git.diff.contextSize and an option could be introduced for setting the display of whitespaces in diffs on startup, such as git.diff.showWhitespace.)
Describe alternatives you've considered
Creating a custom command that I can map to some key from lazygit itself, so I don't have to run a separate terminal with the git cli.
I have also tried looking for a gitconfig setting alongside status.renames, diff.renames and merge.renames, but couldn't find what I'd like. (The related *.renameLimit options affect the number of files considered, not the similarity threshold.)
ps. I am willing to towards this as a PR, but I would first like to get confirmation that it would be a welcome contribution.