From: Johannes Sixt Date: Fri, 05 Mar 2010 15:34:01 GMT Subject: Re: gitignore broken in git 1.7.0.1: slash checks leading dirs Message-ID: <4B912469.8060705@viscovery.net> In-Reply-To: <20100305151248.GA24748@progeny.tock> Jonathan Nieder schrieb: > ยท Otherwise, git treats the pattern as a shell glob suitable for > consumption by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the > pattern will not match a / in the pathname. For example, > "Documentation/*.html" matches "Documentation/git.html" and > "tools/perf/Documentation/perf-diff.html" but not > "Documentation/ppc/ppc.html". This is not correct: When the pattern "Documentation/*.html" matches "Documentation/git.html", then it cannot match "tools/perf/Documentation/perf-diff.html". This is because patterns that contain a slash (after stripping a trailing slash) are anchored at the directory that contains the .gitignore. Said pattern would match the latter name only if it appeared in tools/perf/.gitignore (but in this case it wouldn't match the former name, of course). -- Hannes