Skip to content

feature request: enable setting rename threshold as diffview command option #301

Description

@jakubbortlik

Hello @dlyongemallo, very early on in your fork, you implemented the possibility to customize the rename threshold. I realize that in my original diffivew.nvim issue I was not very specific about the desired behaviour, but now when I'm finally trying to make use of this in gitlab.nvim, I find the implementation as a global diffview config a little cumbersome.

The reason we need to set the rename threshold is that in the plugin we want to mirror the settings Gitlab uses for diffing files, otherwise creating MR comments can fail with incorrectly recognized renames. However, the implementation as a global diffivew config either forces us to recommend users setting this in their config, which may not be what they want to do globally, and if they forget, the gitlab.nvim plugin may not work for them as it should. Otherwise, we have to override their config see my open PR there and reset the config when they are done reviewing a MR. Overriding the config doesn't even work...

I wonder whether it would be possible to implement this instead as a diffview command option, similar to --imply-local, so that we could simply do here something like local diffview_open_command = "DiffviewOpen --find-renames=30%" (this mirrors the name of the option in git diff, but of course it could just as well be called --rename-threshold to keep it in line with the global setting).

Ideally, this option should be available also for other commands like DiffviewFileHistory which will be used in gitlab.nvim for browsing a MR's commits.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions