{"thread":{"id":"19513","subject":"\"git ls-files -i\" does not shows ignored files on Windows","startedAt":"2009-05-26T17:36:40Z","lastAt":"2009-05-27T03:37:42Z","messageCount":2,"participants":["Constantine Plotnikov","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"114741","messageId":"85647ef50905261036u2d3c00c9lcf0df8f29de051ef@mail.gmail.com","threadId":"19513","inReplyTo":null,"subject":"\"git ls-files -i\" does not shows ignored files on Windows","fromName":"Constantine Plotnikov","fromEmail":"constantine.plotnikov@gmail.com","sentAt":"2009-05-26T17:36:40Z","receivedAt":"2009-05-26T17:36:40Z","isPatch":false,"sender":{"key":"constantine.plotnikov@gmail.com","avatar":null},"body":"I have encountered a strange problem on Windows (cygwin git 1.6.1.2\nand msys git version 1.6.2.2.1669.g7eaf8).\n\nLets execute the following sequence of commands:\n\ngit init\necho a >.gitignore\necho test >a\ngit ls-files -i --exclude-standard\n\nThe last command in the sequence gives an empty output. But \"git\nstatus\" and \"git ls-files -o --exclude-standard\" show only\n\".gitignore\" file as untracked. So the file \"a\" is considered as\nignored by git, but it is not displayed in output \"git ls-files -i\n--exclude-standard\".\n\nDoes the bug happen on other platforms and versions of git?\n\nRegards,\nConstantine\n"},{"id":"114758","messageId":"slrnh1pdc6.ojl.sitaramc@sitaramc.homelinux.net","threadId":"19513","inReplyTo":"85647ef50905261036u2d3c00c9lcf0df8f29de051ef@mail.gmail.com","subject":"Re: \"git ls-files -i\" does not shows ignored files on Windows","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-05-27T03:37:42Z","receivedAt":"2009-05-27T03:37:42Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On 2009-05-26, Constantine Plotnikov <constantine.plotnikov@gmail.com> wrote:\n> I have encountered a strange problem on Windows (cygwin git 1.6.1.2\n> and msys git version 1.6.2.2.1669.g7eaf8).\n>\n> Lets execute the following sequence of commands:\n>\n> git init\n> echo a >.gitignore\n> echo test >a\n> git ls-files -i --exclude-standard\n>\n> The last command in the sequence gives an empty output. But \"git\n> status\" and \"git ls-files -o --exclude-standard\" show only\n> \".gitignore\" file as untracked. So the file \"a\" is considered as\n> ignored by git, but it is not displayed in output \"git ls-files -i\n> --exclude-standard\".\n>\n> Does the bug happen on other platforms and versions of git?\n\nhere's what works, after I used your 4 commands on an empty\ndirectory.  Numbers in parens added for the purpose of this\nemail, the rest is a straight paste:\n\n    $ git ls-files -i --exclude-standard -o (1)\n    a\n    $ git ls-files -o (2)\n    .gitignore\n    a\n    $ git add a\n    The following paths are ignored by one of your .gitignore\n    files:\n    a\n    Use -f if you really want to add them.\n    fatal: no files added\n    $ git add -f a\n    $ git ls-files -i --exclude-standard (3)\n    a\n    $\n\n(1) your \"a\" is untracked right now, so ls-files seems to\nconsider it part of \"other\" files.\n\n(2) and indeed, using just \"-o\" does show the file\n\n(3) and when you forcibly add it, then you can see it with\nyour original command.\n\nYes, I agree it doesn't make too much sense.  I have long\nhad the following aliases in my gitconfig:\n\n    ls-del  = ls-files -d\n    ls-mod  = ls-files -m   # this will include deleted files also\n    ls-new  = ls-files --exclude-standard -o\n    ls-ign  = ls-files --exclude-standard -o -i\n\nHTH and all that,\n\nSitaram\n"}]}