Skip to content

blame: teach git_blame_config about diff.renameThreshold#894

Draft
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/blame-rename-fix
Draft

blame: teach git_blame_config about diff.renameThreshold#894
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/blame-rename-fix

Conversation

@tyrielv
Copy link
Copy Markdown

@tyrielv tyrielv commented Apr 20, 2026

blame's config callback did not load diff.renameThreshold because it chained directly to git_default_config, skipping git_diff_basic_config (and git_diff_ui_config) where that setting is handled. As a result, repo_diff_setup() always saw a zero rename_score, and blame fell back to DEFAULT_RENAME_SCORE (50%) regardless of the configured threshold.

Fix this by forwarding diff.renamethreshold to git_diff_basic_config, following the existing pattern used for diff.algorithm.

Also move diff.renameThreshold from git_diff_ui_config to git_diff_basic_config, alongside the related diff.renameLimit setting, so that plumbing commands that use git_diff_basic_config can also pick it up.

Assisted-by: Claude Opus 4.6

blame's config callback did not load diff.renameThreshold because it
chained directly to git_default_config, skipping git_diff_basic_config
(and git_diff_ui_config) where that setting is handled.  As a result,
repo_diff_setup() always saw a zero rename_score, and blame fell back
to DEFAULT_RENAME_SCORE (50%) regardless of the configured threshold.

Fix this by forwarding diff.renamethreshold to git_diff_basic_config,
following the existing pattern used for diff.algorithm.

Also move diff.renameThreshold from git_diff_ui_config to
git_diff_basic_config, alongside the related diff.renameLimit setting,
so that plumbing commands that use git_diff_basic_config can also pick
it up.

Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Assisted-by: Claude Opus 4.6
Comment thread builtin/blame.c
return 0;
}

if (!strcmp(var, "diff.renamethreshold"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm. I do not see any diff.renames prior art in this file. Is it possible that diff.renames is not heeded by git blame? If so, it would probably make more sense to add blame.rename* config settings for all three of these diff.rename* settings.

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