From: Junio C Hamano Date: Wed, 25 Jan 2006 02:08:24 GMT Subject: Re: git-ls-files in subdirectories ignore higher-up .gitignore Message-ID: <7vhd7t3vqf.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <1138125570.24415.11.camel@dv> Pavel Roskin writes: > This can be demonstrated in git's own repository: > > $ touch t/test.o > $ git-ls-files --others --exclude-per-directory=.gitignore > $ cd t > $ git-ls-files --others --exclude-per-directory=.gitignore > test.o > $ > > Before I attempt to fix it, I'd like to make sure it's a bug, not a > feature. I am not sure if that is a bug or a feature, but you are right. We do not bother to go uplevel and look for .gitignore in the current code. It would probably be a welcome addition if your fix made these two sequences work similarly modulo leading paths from the command output. I think it is natural to expect they are moral equivalents: (Sequence 1) $ touch t/test.o t/garbage $ git-ls-files -o --exclude-per-directory=.gitignore t/ (Sequence 2) $ touch t/test.o t/garbage $ cd t $ git-ls-files -o --exclude-per-directory=.gitignore