On Fri, May 31, 2013 at 04:22:37PM -0400, Roland Schulz wrote:
> the gitignore rules work so that if a directory is ignored, all files
> in that directory are ignored. While that behavior isn't clearly
> documented in gitignore, this behavior is consistent across all git
> tools (status, ls-files, ...).
> An exception is that listing the ignored files using "ls-files -i"
> doesn't behave the same way.
> $ mkdir d
> $ touch d/f
> $ echo /d/ > .gitignore
> $ git ls-files -o --exclude-standard
> .gitignore #d/f is correctly not listed
> $ git ls-files -i --exclude-standard
> #no output
> d/f isn't listed even though it is treated as an ignored file by all
> other git tools. That seems inconsistent to me. Is that behavior
> intentionally or is this a bug?
It is listed with "git ls-files -i -o --exclude-standard". The
Show only ignored files in the output. When showing files in the
index, print only those matched by an exclude pattern. When showing
"other" files, show only those matched by an exclude pattern.
If you do this then it is shown:
$ git add -f d/f
$ git ls-files -i --exclude-standard
I think this is working as documented.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html