Skip to content

diff: add renameThreshold configuration option#878

Open
tyrielv wants to merge 2 commits intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/rename-threshold-config
Open

diff: add renameThreshold configuration option#878
tyrielv wants to merge 2 commits 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.

dscho
dscho previously approved these changes Apr 17, 2026
Copy link
Copy Markdown
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has a lot of merit!

Comment thread Documentation/config/diff.adoc
Comment thread builtin/commit.c
@tyrielv tyrielv force-pushed the tyrielv/rename-threshold-config branch from d853311 to 6cb1da8 Compare April 17, 2026 19:01
@tyrielv tyrielv marked this pull request as ready for review April 17, 2026 19:04
@tyrielv tyrielv force-pushed the tyrielv/rename-threshold-config branch from 6cb1da8 to 7fe3ea7 Compare April 17, 2026 19:07
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>
@tyrielv tyrielv force-pushed the tyrielv/rename-threshold-config branch from 7fe3ea7 to da97bbe Compare April 17, 2026 19:08
Comment thread Documentation/config/diff.adoc Outdated
Just a minor AsciiDoc fix.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Copy link
Copy Markdown
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@dscho dscho enabled auto-merge April 17, 2026 20:09
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.

2 participants