Am 23.04.22 um 07:25 schrieb Matthias Aßhauer: > Git 2.36.0 (or more precisely 244c27242f (diff.[ch]: have diff_free() > call clear_pathspec(opts.pathspec), 2022-02-16)) introduced some > change in behaviour that causes gitks highlight feature not to work > correctly anymore. > > Here's a quick reproducer based on git.git: > > git checkout 244c27242f44e6b88e3a381c90bde08d134c274b~1 > make install > git checkout 244c27242f44e6b88e3a381c90bde08d134c274b > PATH=~/bin:$PATH ~/bin/gitk > # In commit 4c53a8c20f (Git 2.35.1, 2022-01-28) (2nd from the top) > # right click GIT-VERSION-GEN and select "Highlight this only". > # You'll see 4c53a8c20f (Git 2.35.1, 2022-01-28) and > # 89bece5c8c (Git 2.35, 2022-01-24) highlighted, but not the surrounding > # commits. Exit gitk. > make install > PATH=~/bin:$PATH ~/bin/gitk > # In commit 4c53a8c20f (Git 2.35.1, 2022-01-28) (2nd from the top) > # right click GIT-VERSION-GEN and select "Highlight this only". > # Almost every non-merge commmit will be highlighted. > > I think this is a change in behaviour in `git diff-tree`, but I'm > honestly not sure what arguments gitk passes to `git diff-tree`, so > I'm struggling to figure out what exactly changed. > > This issue was originally reported as a Git for Windows issue [1], > but I can also reproduce it on Linux. > > [1] https://github.com/git-for-windows/git/issues/3815 gitk does something like this to find commits that touched that file (just with more commits): # v2.25.3 $ git rev-parse 4c53a8c20f ff5b7913f0 | git diff-tree -r -s --stdin GIT-VERSION-GEN 4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a # 244c27242f (diff.[ch]: have diff_free() call clear_pathspec(opts.pathspec), 2022-02-16)) $ git rev-parse 4c53a8c20f ff5b7913f0 | git diff-tree -r -s --stdin GIT-VERSION-GEN 4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a ff5b7913f0af62c26682b0376d0aa2d7f5d74b2e Somewhere in diff-tree a struct diff_options is reused between commits, and the caller expects its pathspec to be preserved, but 244c27242f clears it. With the path filter gone, the following commits match. René