Re: refining .gitignores
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Nov 15, 2007, 21:56 UTC
- Message-ID
- <alpine.LFD.0.9999.0711151349560.4260@woody.linux-foundation.org>
- In-Reply-To
- <20071115211727.GC3552@steel.home>
On Thu, 15 Nov 2007, Alex Riesen wrote:
> > No, I honestly believed that Git-known files can be ignored. According > to Linus I must be wrong, but I have an excuse:
I do think we're not necessarily entirely consistent wrt ignore files.
In particular, git-ls-files itself actually is pretty special, because it has two totally different modes:
- you can ask for "other" files (and this is where you'd be expected to use .gitignore)
- you can just list the files git knows about (and this is where you'd generally be expected to *not* use .gitignore)
..and to make matters more interesting, "git add" used to do the former (it was just a thin script around "git-ls-files -o") but then was later enhanced to also take already-known files into account, so I am not at all surprised if we actually get confused because we used to have a fairly clear separation of the two cases but then we started mixing them up.
So while I think that ".gitignore" *should* only affect files that we don't already know about (ie effectively only file lists that come from "readdir()", not from internal git data structures), I would not be at all surprised if there are bugs.
Linus