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 -- gitgitgadget