From: Junio C Hamano Date: Tue, 19 Mar 2013 18:10:08 GMT Subject: Re: [regression?] trailing slash required in .gitattributes Message-ID: <7vsj3ri7lr.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130319175756.GA13760@sigill.intra.peff.net> Jeff King writes: > Prior to v1.8.1.1, if I did this: > > git init > echo content >foo && > mkdir subdir && > echo content >subdir/bar && > echo "subdir export-ignore" >.gitattributes > git add . && > git commit -m one && > git archive HEAD | tar tf - > > my archive would contain only "foo" and ".gitattributes", not subdir. As > of v1.8.1.1, the attribute on subdir is ignored unless it is written > with a trailing slash, like: > > subdir/ export-ignore > > The issue bisects to 94bc671 (Add directory pattern matching to > attributes, 2012-12-08). That commit actually tests not only that > "subdir/" matches, but also that just "subdir" does not match. > > The commit message there is vague about the reasoning, but my > understanding is that it was meant to harmonize gitignore and > gitattributes, the former of which can take "dir/". I don't have a > problem with offering "dir/" to match only directories, but what is the > point in disallowing just "dir" to match a directory? > > It seems like a pointless regression to me, but I'm not clear whether it > was intentional or not (and if it was intentional, I think we would need > to handle it with a proper transition period, not in a maint release). I agree that is a pointless regression.