Subject: Re: Bug: `git show` honors path filters only for the first commit

From: Junio C Hamano <[email-masked]>
Date: Fri, 29 Apr 2022 21:59:58 -0700

Daniel Li <[email-masked]> writes:

> git version: 2.36.0
> OS: macOS Monterey 12.2.1
> Installed via: homebrew

I think this is the same regression as the recently talked about
"diff-tree --stdin" aka "gitk" regression.

https://lore.kernel.org/git/[email-masked]/

e900d494 (diff: add an API for deferred freeing, 2021-02-11), broke
cmd_log_walk(), and we started to lose some setting that was parsed
from the command line and stored in the diff_options structure after
cmd_log_walk() runs just once.  But "git show A B" runs the function
once for each commit.   A recent change in 2.36.0 made it worse by
adding <pathspec> to the set of setting that gets lost after
cmd_log_walk() runs once.

Thanks for a report.