Subject: Re: [PATCH v5 2/2] blame: make diff algorithm configurable

From: Junio C Hamano <[email-masked]>
Date: Fri, 07 Nov 2025 07:57:15 -0800

"Antonin Delpeuch via GitGitGadget" <[email-masked]> writes:

> From: Antonin Delpeuch <[email-masked]>
>
> The diff algorithm used in 'git-blame(1)' is set to 'myers',
> without the possibility to change it aside from the `--minimal` option.
>
> There has been long-standing interest in changing the default diff
> algorithm to "histogram", and Git 3.0 was floated as a possible occasion
> for taking some steps towards that:
>
> https://lore.kernel.org/git/[email-masked]/
>
> As a preparation for this move, it is worth making sure that the diff
> algorithm is configurable where useful.
>
> Make it configurable in the `git-blame(1)` command by introducing the
> `--diff-algorithm` option and make honor the `diff.algorithm` config
> variable. Keep Myers diff as the default.
>
> Signed-off-by: Antonin Delpeuch <[email-masked]>
> ---

This step does not have anything surprising in it, knowing what the
previous iteration contained.  Looking good.

Other than that many redirections into a file are written with a
space between redirection operator and its target, i.e.

    command > output &&

that should be, according to the coding guidelines, written like

    command >output &&

that is.

> +test_expect_success 'blame respects the order of diff options' '
> +	cat >expected <<-\EOF &&
> +...
> +	EOF
> +
> +	git blame file.txt --minimal --diff-algorithm myers > output &&
> +	sed -e "s/^[^ ]* (\([^ ]*\) [^)]*)/\1/g" output > actual &&
> +	test_cmp expected actual
> +'

Thanks.