{"thread":{"id":"54081","subject":"gitignore does not ignore wildcard directory if it is a link","startedAt":"2020-08-21T13:37:26Z","lastAt":"2020-08-21T16:47:19Z","messageCount":2,"participants":["voxspox","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"404138","messageId":"0179b688-576b-7423-8824-9b57fe8f92fc@gmx.net","threadId":"54081","inReplyTo":null,"subject":"gitignore does not ignore wildcard directory if it is a link","fromName":"voxspox","fromEmail":"voxspox@gmx.net","sentAt":"2020-08-21T13:37:15Z","receivedAt":"2020-08-21T13:37:26Z","isPatch":false,"sender":{"key":"voxspox@gmx.net","avatar":null},"body":"\nHi,\n\nI start with a scenario:\n\ncontents of working copy:\n\n/somefile1\n/test/dir1  (directory)\n/test/dir2  (link to directory)\n/test/dir3  (link to directory)\n/test/file1\n\nI want to ignore all subfolders in \"test\", thus I modified my .gitignore to:\n\n/test/*/\n\n\n> git status\n\nUntracked files:\n  test/dir2\n  test/dir3\n\n\nPutting \"/test/dir3\" into .gitignore will work fine.\n\n\n-> It seems that directories are not ignored by a wildcard pattern if\nthe directory is a link\nusing: 2.25.1 on Linux\n\n\nregards Knut\n\n\n\n"},{"id":"404149","messageId":"xmqqa6yo9cao.fsf@gitster.c.googlers.com","threadId":"54081","inReplyTo":"0179b688-576b-7423-8824-9b57fe8f92fc@gmx.net","subject":"Re: gitignore does not ignore wildcard directory if it is a link","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-08-21T16:46:55Z","receivedAt":"2020-08-21T16:47:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"voxspox <voxspox@gmx.net> writes:\n\n> /somefile1\n> /test/dir1  (directory)\n> /test/dir2  (link to directory)\n> /test/dir3  (link to directory)\n> /test/file1\n>\n> I want to ignore all subfolders in \"test\", thus I modified my .gitignore to:\n>\n> /test/*/\n>\n>\n>> git status\n>\n> Untracked files:\n>   test/dir2\n>   test/dir3\n>\n>\n> Putting \"/test/dir3\" into .gitignore will work fine.\n>\n>\n> -> It seems that directories are not ignored by a wildcard pattern if\n> the directory is a link\n\nThis is working as designed, intended and expected, I would think.\nGit does track symbolic links as the first-class citizen, and dir2\nand dir3 in the above example are *not* directories.\n"}]}