{"thread":{"id":"26658","subject":"Behavior of git ls-files","startedAt":"2011-03-04T17:38:31Z","lastAt":"2011-03-05T08:47:33Z","messageCount":2,"participants":["Steffen Jaeckel","Clemens Buchacher"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162779","messageId":"691824945.20110304183831@stzedn.de","threadId":"26658","inReplyTo":null,"subject":"Behavior of git ls-files","fromName":"Steffen Jaeckel","fromEmail":"steffen.jaeckel@stzedn.de","sentAt":"2011-03-04T17:38:31Z","receivedAt":"2011-03-04T17:38:31Z","isPatch":false,"sender":{"key":"steffen.jaeckel@stzedn.de","avatar":"https://gravatar.com/avatar/12d8a352f2825a89f36bd8d4a5742311b23d75a446c096949afa4a9f16274bf4?d=mp&s=160"},"body":"Hi,\n\nI want to list all files in a repository that are tracked, but shall be ignored\nwhen following the patterns in .gitignore\nI tried to do this by \"git ls-files --exclude-standard -i\" but it seems as if it\ndoesn't properly handle directory entries in .gitignore\n\nThe following example shall reproduce this issue:\n\n> $ mkdir test\n> $ cd test\n> $ git init\n> $ mkdir testdir\n> $ touch testdir/test\n> $ git add testdir/test\n> $ git commit -m \"add test\"\n> $ echo \"testdir/\" > .gitignore\n> $ git ls-files --exclude-standard -i\n\nIs the behavior of git ls-files correct or not?\n\nThanks,\nSteffen\n"},{"id":"162809","messageId":"20110305084733.GA3039@toss","threadId":"26658","inReplyTo":"691824945.20110304183831@stzedn.de","subject":"Re: Behavior of git ls-files","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2011-03-05T08:47:33Z","receivedAt":"2011-03-05T08:47:33Z","isPatch":false,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Fri, Mar 04, 2011 at 06:38:31PM +0100, Steffen Jaeckel wrote:\n> \n> Is the behavior of git ls-files correct or not?\n\nIndeed, the behavior is not correct. It does not find any files\nwhich are excluded only due to a directory exclude.\n\nIn the cases without -i we do not even have to look at files under\nan ignored directory. So the matching rules are not applied\ncorrectly in this case.\n\nWe have the same problem with git ls-files -i -o, unless you also\nspecify --directory (in which case, again, we do not need to look\nat files under the ignored directory).\n\nClemens\n"}]}