Re: Possible bug in git-completion.sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 08, 2010 at 08:38:39AM -0800, Junio C Hamano wrote:

> Jeff King <peff@xxxxxxxx> writes:
> 
> > 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]