{"thread":{"id":"47044","subject":"clarify documentation of leading \"**\" in gitignore(5) man page","startedAt":"2017-10-27T14:51:21Z","lastAt":"2017-10-27T14:51:21Z","messageCount":1,"participants":["David Prager Branner"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"331153","messageId":"alpine.DEB.2.20.1710271043190.1400@brannerchinese","threadId":"47044","inReplyTo":null,"subject":"clarify documentation of leading \"**\" in gitignore(5) man page","fromName":"David Prager Branner","fromEmail":"dpb@brannerchinese.com","sentAt":"2017-10-27T14:51:14Z","receivedAt":"2017-10-27T14:51:21Z","isPatch":false,"sender":{"key":"dpb@brannerchinese.com","avatar":null},"body":"I've long been confused by something in the man page for gitignore. I think it's unclear and I'd like to propose a change. The passage is this (source at https://git.kernel.org/pub/scm/git/git-manpages.git/tree/man5/gitignore.5):\n\n> Two consecutive asterisks (\"**\") in patterns matched against full\n> pathname may have special meaning:\n>\n> o   A leading \"**\" followed by a slash means match in all directories.\n>     For example, \"**/foo\" matches file or directory \"foo\" anywhere, the\n>     same as pattern \"foo\". \"**/foo/bar\" matches file or directory \"bar\"\n>     anywhere that is directly under directory \"foo\".\n>\n> ...\n\nIn the first paragraph, it would be clearer to specify:\n\n> Two consecutive asterisks (\"**\"), in patterns matched against a full\n> pathname, are a wildcard representing some arbitrary number of nested\n> directories within that pathname:\n\nIn the second paragraph, I suggest removing the first pattern, \"**/foo\", since it is completely redundant. There are no circumstances when \"**/foo\" is necessary in place of plain \"foo\", and its presence muddies discussion.\n\nLeading \"**\" may represent nested directories in a pathname, but is useful only before a _pattern_ containing nested directories. I suggest making that explicit. Here is how I propose to rewrite it:\n\n> o   A leading \"**\", followed by a slash and a pattern containing nested\n>     directories, means match that pattern in all pathnames.\n>     For example, \"**/foo/bar\" matches file or directory \"bar\"\n>     anywhere that is directly under directory \"foo\". It would match\n>     \"foo/bar\", \"other/foo/bar\", \"src/foo/bar/scram/gravy\".\n\nThanks.\n\n- dpb\n"}]}