Re: Git ignore help

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

 



On Tue, Mar 24, 2015 at 7:46 PM,  <mdconf@xxxxxxxxx> wrote:
> Duy, you wrote:
>
> "This is true. To elaborate, if we have to recurse in excluded directories so that we can include some back, then the reason for excluding is already defeated as we may need to traverse the entire directory structure. However in this particular case where we do know in advance that only certain directories may have "re-include" rules, e.g. "db", "reports" or "scripts", we could keep going for a while."
>
> ... so according to that it sounds like including /db, /reports, /scripts should actually also NOT work. But it does work - i.e. when I add the following:
>
> # exclude
> /*
>
> # except
> !/db
> !/reports
> !/scripts
>
> then any content within those 3 directories (and their sub directories) is included and not ignored...
>
> It ONLY does not work when I add more levels - e.g.:
>
> !/reports/something
>
> In this case neither /reports nor /reports/something or any sub directory is included.

Yes. It's the subtlety of optimizing ;-) If you read the man page
really carefully (*), "if the _parent_ directory of that file(**) is
excluded" and the parent of these three directories is _not_ excluded.

(*) I'm not saying this is a good thing. Only docs such as language
spec or RFCs need that level of attention. But I'm not a good document
writer myself, can't blame others. Improvements are welcome though.

(**) "that file" should be "that file or directory" but I guess
simplification here is ok
-- 
Duy
--
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]