Skip to content

diff: add renameThreshold configuration option#878

Draft
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/rename-threshold-config
Draft

diff: add renameThreshold configuration option#878
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/rename-threshold-config

Conversation

@tyrielv
Copy link
Copy Markdown

@tyrielv tyrielv commented Apr 8, 2026

Add diff.renameThreshold, merge.renameThreshold, and status.renameThreshold configuration options to control the minimum similarity threshold for rename detection without requiring command-line flags.

The cascade follows the existing pattern for renameLimit and renames:

  • merge.renameThreshold overrides diff.renameThreshold for merges
  • status.renameThreshold overrides diff.renameThreshold for status
  • CLI flags (-M, --find-renames) override all config values

The value accepts the same format as -M: a percentage (e.g. 50%) or a fraction (e.g. 0.5). If unset, the default remains 50%.

This also gives git-blame users control over the rename threshold for the first time, since blame has no -M threshold flag but inherits diff.renameThreshold via repo_diff_setup().

Assisted-by: Claude Opus 4.6


Thanks for taking the time to contribute to Git!

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

  • This is an early version of work already under review upstream.
  • This change only applies to interactions with Azure DevOps and the
    GVFS Protocol.
  • This change only applies to the virtualization hook and VFS for Git.

Add diff.renameThreshold, merge.renameThreshold, and
status.renameThreshold configuration options to control the minimum
similarity threshold for rename detection without requiring
command-line flags.

The cascade follows the existing pattern for renameLimit and renames:
  - merge.renameThreshold overrides diff.renameThreshold for merges
  - status.renameThreshold overrides diff.renameThreshold for status
  - CLI flags (-M, --find-renames) override all config values

The value accepts the same format as -M: a percentage (e.g. 50%) or
a fraction (e.g. 0.5). If unset, the default remains 50%.

This also gives git-blame users control over the rename threshold
for the first time, since blame has no -M threshold flag but inherits
diff.renameThreshold via repo_diff_setup().

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant