git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] diff algorithm selection issue

From
Yydirson@free.fr <ydirson@free.fr>
Date
May 26, 2020, 17:21 UTC
Message-ID
<505382066.1036329918.1590513687177.JavaMail.root@zimbra39-e7>
In-Reply-To
<253380167.1036247407.1590512216359.JavaMail.root@zimbra39-e7>
Show 23 quoted lines
> > > When the config has diff.algorithm=patience set, "git diff
> > > --minimal" seems to
> > > be ignored, and does not give the same output as "git diff
> > > --diff-algorithm=minimal",
> > > but really the same as "git diff --diff-algorithm=patience".
> > 
> > As I wrote, that is absolutely the intended behaviour.
> > 
> > When patience and other algorithm learns how to trade cycles off
> > with output size, --minimal may make a difference, but unlike
> > "--diff-algorithm=minimal" that forces Myers algorithm, the
> > "--minimal" option should not change the underlying algorithm.
> 
> OK, so then the problem is just in the doc, where
> --diff-algorithm=minimal
> should rather be documented as something like:
> 
>  The basic greedy "myers" diff algorithm, spending extra time to make
>  sure the smallest possible diff is produced (equivalent to
>  `--diff-algorithm=myers --minimal`).
> 
> Or is it rather intended to be `--diff-algorithm=default --minimal`,
> whatever the default may be in the future ?

Now that I think about it, do we really want "minimal" as a valid choice for --diff-algorithm, if it's not a choice of algorithm ?

In that case, we may need a separate config option line diff.algorithm.minimal or maybe diff.algorithm.tuning ?

Show 21 quoted lines
> 
> 
> As for the other flags, --patience and --histogram should probably
> documented as backward-compatibility aliases for --diff-algorithm=,
> right ?
> 
> 
> I'll send a formal patch if all of this sounds good.
> 
> 
> And as a last point, there would be the problem shown by patience
> diff
> on the commit referenced in my original post - If patience is still
> considered for promotion to default some day, I guess we wouldn't
> want
> it to make such a bad choice.
> 
> Best regards,
> --
> Yann
> 
Previous: ydirson@free.frNext: Junio C Hamano
Message 5 of 6 in “[BUG] diff algorithm selection issue”
  1. ydirson@free.frMay 26, 2020
  2. Junio C HamanoMay 26, 2020
  3. Junio C HamanoMay 26, 2020
  4. ydirson@free.frMay 26, 2020
  5. ydirson@free.frMay 26, 2020
  6. Junio C HamanoMay 26, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.