From: Junio C Hamano Date: Wed, 14 May 2025 21:10:10 GMT Subject: Re: [PATCH RFC] diff --no-index: teach option to exclude files by pattern Message-ID: In-Reply-To: <20250514204014.3106177-1-jacob.e.keller@intel.com> Jacob Keller writes: > From: Jacob Keller > > Teach git diff --no-index the ability to exclude files by wildmatch > pattern when recursing through directories. The '--exclude' option > builds up a string list containing the patterns. These are checked with > wildmatch() in the read_directory_contents function. If any pattern > matches, then the file is not included in the directory contents. A quite natural question that comes to mind is: How would we do this for the normal "git diff" that is not the bolted on '--no-index' mode? but ... > The --exclude option is only supported by the --no-index mode. Standard > diff modes support negative pathspecs which is more powerful. I tried to > see if there was a way to add support for negative pathspecs themselves, > but haven't yet figured out if this is possible. ... of course you have thought about it already. I do agree with you that we should figure out how and teach this mode to also use pathspec, not necessarily only the negative ones but positive ones. After all, $ git diff --no-index [