Re: [PATCH v5 2/2] blame: make diff algorithm configurable
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 7, 2025, 15:57 UTC
- Message-ID
- <xmqqbjldhm3o.fsf@gitster.g>
- In-Reply-To
- <60015bbadaf90f40b3b56d2e32b9f48818cb8675.1762468914.git.gitgitgadget@gmail.com>
"Antonin Delpeuch via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 20 quoted lines
> From: Antonin Delpeuch <antonin@delpeuch.eu> > > 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/xmqqed873vgn.fsf@gitster.g/ > > 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 <antonin@delpeuch.eu> > ---
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.
Show 9 quoted lines
> +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.