{"thread":{"id":"34004","subject":"ls-files -i & directories","startedAt":"2013-05-31T20:22:37Z","lastAt":"2013-05-31T21:20:22Z","messageCount":2,"participants":["Roland Schulz","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"219107","messageId":"CAO2Twbk5cvEa2uNKMg+n4DFokJ607yRDF0dUeBJkUOAY6BAD2A@mail.gmail.com","threadId":"34004","inReplyTo":null,"subject":"ls-files -i & directories","fromName":"Roland Schulz","fromEmail":"roland@utk.edu","sentAt":"2013-05-31T20:22:37Z","receivedAt":"2013-05-31T20:22:37Z","isPatch":false,"sender":{"key":"roland@utk.edu","avatar":null},"body":"Hi,\n\nthe gitignore rules work so that if a directory is ignored, all files\nin that directory are ignored. While that behavior isn't clearly\ndocumented in gitignore, this behavior is consistent across all git\ntools (status, ls-files, ...).\n\nAn exception is that listing the ignored files using \"ls-files -i\"\ndoesn't behave the same way.\n\nexample:\n$ mkdir d\n$ touch d/f\n$ echo /d/ > .gitignore\n$ git ls-files -o --exclude-standard\n.gitignore #d/f is correctly not listed\n$ git ls-files -i --exclude-standard\n#no output\n\nd/f isn't listed even though it is treated as an ignored file by all\nother git tools. That seems inconsistent to me. Is that behavior\nintentionally or is this a bug?\n\nA very similar question was asked before:\nhttp://git.661346.n2.nabble.com/git-ls-files-ignored-and-ignored-directory-tt7570641.html\nbut without an answer.\n\nRoland\n\n-- \nORNL/UT Center for Molecular Biophysics cmb.ornl.gov\n865-241-1537, ORNL PO BOX 2008 MS6309\n"},{"id":"219108","messageId":"20130531212022.GD1072@serenity.lan","threadId":"34004","inReplyTo":"CAO2Twbk5cvEa2uNKMg+n4DFokJ607yRDF0dUeBJkUOAY6BAD2A@mail.gmail.com","subject":"Re: ls-files -i & directories","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-05-31T21:20:22Z","receivedAt":"2013-05-31T21:20:22Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Fri, May 31, 2013 at 04:22:37PM -0400, Roland Schulz wrote:\n> Hi,\n> \n> the gitignore rules work so that if a directory is ignored, all files\n> in that directory are ignored. While that behavior isn't clearly\n> documented in gitignore, this behavior is consistent across all git\n> tools (status, ls-files, ...).\n> \n> An exception is that listing the ignored files using \"ls-files -i\"\n> doesn't behave the same way.\n> \n> example:\n> $ mkdir d\n> $ touch d/f\n> $ echo /d/ > .gitignore\n> $ git ls-files -o --exclude-standard\n> .gitignore #d/f is correctly not listed\n> $ git ls-files -i --exclude-standard\n> #no output\n> \n> d/f isn't listed even though it is treated as an ignored file by all\n> other git tools. That seems inconsistent to me. Is that behavior\n> intentionally or is this a bug?\n\nIt is listed with \"git ls-files -i -o --exclude-standard\".  The\ndocumentation says:\n\n   Show only ignored files in the output. When showing files in the\n   index, print only those matched by an exclude pattern.  When showing\n   \"other\" files, show only those matched by an exclude pattern.\n\nIf you do this then it is shown:\n\n$ git add -f d/f\n$ git ls-files -i --exclude-standard\nd/f\n\nI think this is working as documented.\n"}]}