Re: [HALF A PATCH] Teach the '--exclude' option to 'diff --no-index'
From: Jakub Narebski <hidden>
Date: 2016-06-15 22:46:15
Johannes Schindelin [off-list ref] writes:
On Fri, 20 Feb 2009, Jeff King wrote:quoted
But more seriously, how would a user expect this to interact with .gitignore? I know gitignore is about ignoring untracked files, but I can't help but feel the two have something in common. But maybe not. I'm sick today and my brain is not working very well.I think that the -x option with regular (not --no-index) diff would be a little different. .gitignore is for "git add" time, while "git diff" happily ignores .gitignore. Besides, the -x option only works on the basenames (as I implemented it; no idea if GNU diff works the same way, but from Michael's patch it looks like it does).
Info: (diff.info.gz)diff Options
`-x PATTERN'
`--exclude=PATTERN'
When comparing directories, ignore files and subdirectories whose
basenames match PATTERN. *Note Comparing Directories::.
`-X FILE'
`--exclude-from=FILE'
When comparing directories, ignore files and subdirectories whose
basenames match any pattern contained in FILE. *Note Comparing
Directories::.
--
Jakub Narebski
Poland
ShadeHawk on #git