From: Junio C Hamano Date: Mon, 04 Aug 2025 00:39:10 GMT Subject: Re: [PATCH v2] diff: ensure consistent diff behavior with -I across output formats Message-ID: In-Reply-To: <20250803145155.57894-1-yldhome2d2@gmail.com> Lidong Yan writes: > `git diff -I` option is inconsistently applied across various > output formats. In some cases, files would appear in the `--name-only` > output but not in the accompanying `--stat` or `-p` outputs, despite > the user explicitly requesting to ignore certain changes using > `-I`. Not only for `-I`, but this inconsistency also > exists for other output formats that have `.diff_from_content` set > (e.g. `-w`, `--ignore-space-at-eol` and `--ignore-space-change`). Perhaps the above (and code, like the name of the helper functions and possibly the name of the new file) should be updated to place much stress on -I, as "ignore-regex" is not any more special than other things that flips .diff_from_content bit in this new iteration of the patch. I do not quite get why ignore_match() has to know so much about how the real code in diff.c that implements -I works, compared to the illustration of "here is how to do it" Peff posted, though. It somehow feels too much duplicated code. Thanks.