{"thread":{"id":"53808","subject":"Bug? of gitignore pattern matching","startedAt":"2020-07-07T12:19:38Z","lastAt":"2020-07-07T12:19:38Z","messageCount":1,"participants":["美纱Misha"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"401091","messageId":"CAMZHuz-Z2HGynUY0R5YDjkN1E12ZtD8h7OsZ9W6mawsxWQODgQ@mail.gmail.com","threadId":"53808","inReplyTo":null,"subject":"Bug? of gitignore pattern matching","fromName":"美纱Misha","fromEmail":"mishanyo1001@gmail.com","sentAt":"2020-07-07T12:19:23Z","receivedAt":"2020-07-07T12:19:38Z","isPatch":false,"sender":{"key":"mishanyo1001@gmail.com","avatar":null},"body":"In document of gitignore I found\n\nAn asterisk \"*\" matches anything except a slash.\n\nThis description well meets what if the asterisk is at the begging or\nin the middle of the pattern.\n\n```\n~/Code/github/test on  master!  20:01:11\n$ git check-ignore -v data/a/b/1\n\n~/Code/github/test on  master!  20:01:18\n$ git check-ignore -v data/a/b/2\n.gitignore:2:data/**/2 data/a/b/2\n\n~/Code/github/test on  master!  20:01:19\n$ git check-ignore -v data/a/b/3\n.gitignore:3:data/***/3 data/a/b/3\n\n~/Code/github/test on  master!  20:01:20\n$ cat .gitignore\ndata/*/1\ndata/**/2\ndata/***/3\n\n~/Code/github/test on  master!  20:01:21\n$ vim .gitignore\n\n~/Code/github/test on  master!  20:01:46\n$ git check-ignore -v a/b/3\n.gitignore:3:***/3 a/b/3\n\n~/Code/github/test on  master!  20:01:51\n$ git check-ignore -v a/b/2\n.gitignore:2:**/2 a/b/2\n\n~/Code/github/test on  master!  20:01:53\n$ git check-ignore -v a/b/1\n\n~/Code/github/test on  master!  20:01:54\n$ cat .gitignore\n*/1\n**/2\n***/3\n\n```\n\n```\n~/Code/github/test on  master!  20:00:13\n$ git check-ignore -v data/1/a/b\n.gitignore:1:data/1/* data/1/a/b\n\n~/Code/github/test on  master!  20:00:22\n$ git check-ignore -v data/2/a/b\n.gitignore:2:data/2/** data/2/a/b\n\n~/Code/github/test on  master!  20:00:25\n$ git check-ignore -v data/3/a/b\n.gitignore:3:data/3/*** data/3/a/b\n\n~/Code/github/test on  master!  20:00:26\n$ cat .gitignore\ndata/1/*\ndata/2/**\ndata/3/***\n```\n\nBut if this asterisk is at the end of the ignore pattern. Seems that\n\"*\" equals to \"**\"\n\n\n\n-----\n\n\nAnd there is another question\n\nOther consecutive asterisks are considered regular asterisks and will\nmatch according to the previous rules.\n\nAnd it seems that triple asterisks act like double ones. What do\nregular asterisks mean, I used to believe they work as a single\nasterisk before testing.  Maybe there is some ambiguity?\n\n\nBest,\nYanxiang Gao\n"}]}