Re: Possible bug in git-completion.sh
From: Jeff King <hidden>
Date: 2016-06-15 22:47:59
On Fri, Jan 08, 2010 at 08:38:39AM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:quoted
Try this: git init touch base-cruft mkdir subdir touch subdir/cruft echo subdir >.gitignore git status ;# shows gitignore and base-cruft git ls-files -o --exclude-standard ;# ditto cd subdir git status . ;# shows nothing, since everything in subdir is ignored git ls-files -o --exclude-standard ;# BUG: shows cruft Yes, ls-files operates in the subdirectory, which means it should not show cruft from the root (and it does not). But it should respect .gitignore directives going all the way back to the root, and it doesn't.Shouldn't the ls-files be run from the root with subdir/ as pathspec, if you wanted to do apples-to-apples comparison between it and status?
Well, yes, if you wanted to compare apples to apples. But actually, my point in showing "status" at all was to note that Michael's statement that they would be the same is wrong. But just looking at the ls-files output, do you not agree that there is a bug? Respecting gitignore means respecting _all_ gitignore files in the repository, not just the subset that you happen to be in. -Peff