git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:00 UTC

Re: [PATCH v3] blame: make diff algorithm configurable

From
Antonin Delpeuch <antonin@delpeuch.eu>
Date
Oct 30, 2025, 09:22 UTC
Message-ID
<33d44dc6-36b3-4736-b3ed-96861a3c4003@delpeuch.eu>
In-Reply-To
<fde3dae1-bb11-45e8-9211-50ae003ca497@gmail.com>
Hi Phillip,
On 29/10/2025 11:16, Phillip Wood wrote:
Show 14 quoted lines
> Unfortunately XDF_DIFF_ALGORITHM_MASK does not include 
> XDF_NEED_MINIMAL so if the user has a config file that looks like
>
>     [diff]
>         algorithm = minimal
>         algorithm = myers
>
> We'll parse it as "minimal" rather than "myers"
>
> As we need to reset the diff algorithm in a number of places I think 
> it would be best to define a macro
>
>         #define CLEAR_DIFF_ALGORITHM(flags) \
>         flags &= ~(XDF_DIFF_ALGORITHM_MASK | XDF_NEED_MINIMAL)
Ouch, good catch! This problem is affecting other places as well.

I'm wondering if we couldn't even add XDF_NEED_MINIMAL to XDF_DIFF_ALGORITHM_MASK. I've reviewed all the places where XDF_DIFF_ALGORITHM_MASK is used, and it seems that in all cases it would either preserve the existing behaviour (potentially allowing us to remove an accompanying "DIFF_XDL_CLR(opts, NEED_MINIMAL);" macro which becomes redundant), or in some other cases it would fix a similar issue (for instance, in merge-file.c).

Is your suggestion to introduce a new macro motivated by stability concerns? I'm aware that xdiff is used in other code bases as a library, so I guess changing XDF_DIFF_ALGORITHM_MASK can indeed be seen as a breaking change.

Antonin
Previous: Junio C HamanoNext: Phillip Wood
Message 12 of 32 in “blame: make diff algorithm configurable”
  1. blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Oct 20, 2025
  2. Junio C HamanoOct 20, 2025
  3. Antonin DelpeuchOct 22, 2025
  4. Junio C HamanoOct 22, 2025
  5. Phillip WoodOct 23, 2025
  6. blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Oct 28, 2025
  7. Junio C HamanoOct 28, 2025
  8. Antonin DelpeuchOct 28, 2025
  9. blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Oct 28, 2025
  10. Phillip WoodOct 29, 2025
  11. Junio C HamanoOct 29, 2025
  12. Antonin DelpeuchOct 30, 2025
  13. Phillip WoodOct 30, 2025
  14. 0/2 blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Nov 1, 2025
  15. 1/2 xdiff: add 'minimal' to XDF_DIFF_ALGORITHM_MASKAntonin Delpeuch via GitGitGadget, Nov 1, 2025
  16. 2/2 blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Nov 1, 2025
  17. Phillip WoodNov 3, 2025
  18. Phillip WoodNov 3, 2025
  19. Junio C HamanoNov 3, 2025
  20. Junio C HamanoNov 6, 2025
  21. 0/2 blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Nov 6, 2025
  22. 1/2 xdiff: add 'minimal' to XDF_DIFF_ALGORITHM_MASKAntonin Delpeuch via GitGitGadget, Nov 6, 2025
  23. 2/2 blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Nov 6, 2025
  24. Phillip WoodNov 7, 2025
  25. Junio C HamanoNov 7, 2025
  26. Junio C HamanoNov 7, 2025
  27. Junio C HamanoNov 17, 2025
  28. 0/2 blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Nov 17, 2025
  29. 1/2 xdiff: add 'minimal' to XDF_DIFF_ALGORITHM_MASKAntonin Delpeuch via GitGitGadget, Nov 17, 2025
  30. 2/2 blame: make diff algorithm configurableAntonin Delpeuch via GitGitGadget, Nov 17, 2025
  31. Phillip WoodNov 17, 2025
  32. Junio C HamanoNov 17, 2025

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.