{"thread":{"id":"50950","subject":"Bug report: `git-ls-files --exclude-standard --ignored --others --directory` gives incomplete output","startedAt":"2019-04-18T06:58:30Z","lastAt":"2019-04-18T06:58:30Z","messageCount":1,"participants":["Carmen Bianca Bakker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"374090","messageId":"f5a8939f2efddb194dadb59c946522a75c5bda53.camel@fsfe.org","threadId":"50950","inReplyTo":null,"subject":"Bug report: `git-ls-files --exclude-standard --ignored --others --directory` gives incomplete output","fromName":"Carmen Bianca Bakker","fromEmail":"carmenbianca@fsfe.org","sentAt":"2019-04-18T06:49:56Z","receivedAt":"2019-04-18T06:58:30Z","isPatch":false,"sender":{"key":"carmenbianca@fsfe.org","avatar":null},"body":"Hi git developers,\n\nApologies in advance if my mailing list etiquette isn't 100% perfect. I\ndon't use mailing lists all that often. Please CC me in replies, because\nI am not subscribed.\n\nI use `git-ls-files` in a project[1] to get a list of ignored\nfiles/directories, and to ignore them in my project.  I found that using\n`--directory` speeds things up by a lot, so I can ignore entire\ndirectories.\n\nHowever, I get inconsistent results between using the --directory flag\nand not.  To demonstrate this, I created a super tiny repository[2]. \nThe repository ignores all `*.mo` files.\n\nI then do:\n\n$ mkdir po/subdir\n$ touch eo.mo po/eo.mo po/subdir/eo.mo\n\nWhen I run `git ls-files --exclude-standard --ignored --others`, my\noutput is:\n\neo.mo\npo/eo.mo\npo/subdir/eo.mo\n\nBut when I run `git ls-files --exclude-standard --ignored --others \n--directory`, my output is:\n\neo.mo\npo/eo.mo\n\nRather strangely, when I alter the command to `git ls-files --exclude-\nstandard --ignored --others --directory --no-empty-directory`, I get:\n\neo.mo\npo/eo.mo\npo/subdir/\n\nThis seems very counter-intuitive to me, because po/subdir/ is an empty\ndirectory in the sense that it contains no files tracked by git.\n\nIs this a bug, or is this a miscomprehension on my part about how `git-\nls-files` is supposed to function?\n\nWith kindness,\nCarmen\n\n\n[1]: <\nhttps://github.com/fsfe/reuse-tool/blob/75c8c1ba0b7fcefc3ab4e132b539f506e18f721c/src/reuse/_util.py#L115\n>\n[2]: <https://github.com/carmenbianca/git-ls-files>\n"}]}