Re: [RFC] extending git-ls-files --exclude.
- From
- Catalin Marinas <catalin.marinas@gmail.com>
- Date
- Jul 25, 2005, 09:19 UTC
- Message-ID
- <tnxmzobutsf.fsf@arm.com>
- In-Reply-To
- <7vd5p73jlu.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> wrote:
> * When --exclude-per-directory=<name> is specified, upon > entering a directory that has such a file, its contents are > appended at the end of the current "list of patterns". They > are popped off when leaving the directory.
[...]
Show 5 quoted lines
> A pattern specified on the command line with --exclude or read > from the file specified with --exclude-from is relative to the > top of the directory tree. A pattern read from a file specified > by --exclude-per-directory is relative to the directory that the > pattern file appears in.
I think it would make more sense for the exclude-per-directory patterns to be local to that directory only, without recursively preserving them for subdirectories. One would, in general, put the common exclude patterns like *.o *~ etc. in the global file (.git/exclude). The patterns local to a directory only (take the vmlinux file for example), one would write it in the .gitignore file but this should be used for subdirectories.
> An exclude pattern is of the following format:
[...]
That's fine. Actually, the Porcelain would care much about it since it gets the information already filtered by git.
Show 5 quoted lines
> $ cat Documentation/.gitignore > # ignore generated html files, > # except foo.html which is maintained by hand > !foo.html > *.html
Wouldn't it be clearer to have the general rules first (*.html), overridden by the more specific ones (!foo.html)? Just my opinion, I don't know what others think.
-- Catalin