mbox series

[0/2] Teach diff to honor diff algorithms set through git attributes

Message ID pull.1452.git.git.1675568781.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series Teach diff to honor diff algorithms set through git attributes | expand

Message

Philippe Blain via GitGitGadget Feb. 5, 2023, 3:46 a.m. UTC
When a repository contains different kinds of files, it may be desirable to
use different algorithms based on file type. This is currently not feasible
through the command line or using git configs. However, we can leverage the
fact that gitattributes are path aware.

Teach the diff machinery to check gitattributes when diffing files.

John Cai (2):
  diff: consolidate diff algorithm option parsing
  diff: teach diff to read gitattribute diff-algorithm

 Documentation/gitattributes.txt |  23 +++++++
 diff.c                          | 112 ++++++++++++++++++++++----------
 diff.h                          |   2 +
 t/lib-diff-alternative.sh       |  27 +++++++-
 4 files changed, 130 insertions(+), 34 deletions(-)


base-commit: a6a323b31e2bcbac2518bddec71ea7ad558870eb
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1452%2Fjohn-cai%2Fjc%2Fattr-diff-algo-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1452/john-cai/jc/attr-diff-algo-v1
Pull-Request: https://github.com/git/git/pull/1452