{"thread":{"id":"31740","subject":"[PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning","startedAt":"2012-10-06T08:38:21Z","lastAt":"2012-10-07T03:13:54Z","messageCount":8,"participants":["Nguyễn Thái Ngọc Duy","Philip Oakley","Nguyen Thai Ngoc Duy","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"200658","messageId":"1349512701-29729-1-git-send-email-pclouds@gmail.com","threadId":"31740","inReplyTo":null,"subject":"[PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-06T08:38:21Z","receivedAt":"2012-10-06T08:38:21Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"We support backslash escape, but we hide the details behind the phrase\n\"a shell glob suitable for consumption by fnmatch(3)\". So it may not\nbe obvious how one can get literal # or ! at the beginning of a pattern.\nAdd a few lines on how to work around the magic characters.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Asciidoc 8.2.6 does not like me writing\n \"Put \\# if you need a literal #..\" so I go with \"backslash\" and\n \"hash\" instead. `\\!` displays fine both in man page and html format.\n '!' changed to `!` because it looks clearer in monospace.\n\n Documentation/gitignore.txt | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 96639e0..8c03ed4 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -74,11 +74,14 @@ PATTERN FORMAT\n    for readability.\n \n  - A line starting with # serves as a comment.\n+   Put a backslash in front of the first hash for the patterns\n+   that start with a hash.\n \n- - An optional prefix '!' which negates the pattern; any\n+ - An optional prefix `!` which negates the pattern; any\n    matching file excluded by a previous pattern will become\n    included again.  If a negated pattern matches, this will\n-   override lower precedence patterns sources.\n+   override lower precedence patterns sources. Use `\\!` if\n+   you need a literal `!` at the beginning of the pattern.\n \n  - If the pattern ends with a slash, it is removed for the\n    purpose of the following description, but it would only find\n-- \n1.7.12.1.406.g6ab07c4\n"},{"id":"200660","messageId":"01ADED0717024E6F93B7FBADB1AEAE6B@PhilipOakley","threadId":"31740","inReplyTo":"1349512701-29729-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2012-10-06T11:33:14Z","receivedAt":"2012-10-06T11:33:14Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Nguyễn Thái Ngọc Duy\" <pclouds@gmail.com>\n> We support backslash escape, but we hide the details behind the phrase\n> \"a shell glob suitable for consumption by fnmatch(3)\". So it may not\n> be obvious how one can get literal # or ! at the beginning of a \n> pattern.\n> Add a few lines on how to work around the magic characters.\n>\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n> Asciidoc 8.2.6 does not like me writing\n> \"Put \\# if you need a literal #..\" so I go with \"backslash\" and\n> \"hash\" instead. `\\!` displays fine both in man page and html format.\n> '!' changed to `!` because it looks clearer in monospace.\n\nWhy not put the backslash-hash in back quotes as well to give the same \nlook/feel consistency?\n\n>\n> Documentation/gitignore.txt | 7 +++++--\n> 1 file changed, 5 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\n> index 96639e0..8c03ed4 100644\n> --- a/Documentation/gitignore.txt\n> +++ b/Documentation/gitignore.txt\n> @@ -74,11 +74,14 @@ PATTERN FORMAT\n>    for readability.\n>\n>  - A line starting with # serves as a comment.\n\n+  A line starting with `#` serves as a comment.\n\n> +   Put a backslash in front of the first hash for the patterns\n> +   that start with a hash.\n>\n+   Use `\\#` if you need a literal `#` at the beginning of the pattern.\n\n> - - An optional prefix '!' which negates the pattern; any\n> + - An optional prefix `!` which negates the pattern; any\n>    matching file excluded by a previous pattern will become\n>    included again.  If a negated pattern matches, this will\n> -   override lower precedence patterns sources.\n> +   override lower precedence patterns sources. Use `\\!` if\n> +   you need a literal `!` at the beginning of the pattern.\n>\n>  - If the pattern ends with a slash, it is removed for the\n>    purpose of the following description, but it would only find\n> -- \n> 1.7.12.1.406.g6ab07c4\n"},{"id":"200661","messageId":"CACsJy8DObOJUSdDPEsTwAKjXMYiOyf7P_6oEE9xbU6QFz7rOxQ@mail.gmail.com","threadId":"31740","inReplyTo":"01ADED0717024E6F93B7FBADB1AEAE6B@PhilipOakley","subject":"Re: [PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-06T11:43:50Z","receivedAt":"2012-10-06T11:43:50Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Oct 6, 2012 at 6:33 PM, Philip Oakley <philipoakley@iee.org> wrote:\n>> Asciidoc 8.2.6 does not like me writing\n>> \"Put \\# if you need a literal #..\" so I go with \"backslash\" and\n>> \"hash\" instead. `\\!` displays fine both in man page and html format.\n>> '!' changed to `!` because it looks clearer in monospace.\n>\n>\n> Why not put the backslash-hash in back quotes as well to give the same\n> look/feel consistency?\n\nBecause asciidoc does not like \\#, '\\#' nor `\\#`. It just shows \\\nwithout # and I don't want to master asciidoc just to make it show \\#.\n-- \nDuy\n"},{"id":"200664","messageId":"20121006132127.GC11712@sigill.intra.peff.net","threadId":"31740","inReplyTo":"CACsJy8DObOJUSdDPEsTwAKjXMYiOyf7P_6oEE9xbU6QFz7rOxQ@mail.gmail.com","subject":"Re: [PATCH] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-10-06T13:21:27Z","receivedAt":"2012-10-06T13:21:27Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Oct 06, 2012 at 06:43:50PM +0700, Nguyen Thai Ngoc Duy wrote:\n\n> On Sat, Oct 6, 2012 at 6:33 PM, Philip Oakley <philipoakley@iee.org> wrote:\n> >> Asciidoc 8.2.6 does not like me writing\n> >> \"Put \\# if you need a literal #..\" so I go with \"backslash\" and\n> >> \"hash\" instead. `\\!` displays fine both in man page and html format.\n> >> '!' changed to `!` because it looks clearer in monospace.\n> >\n> >\n> > Why not put the backslash-hash in back quotes as well to give the same\n> > look/feel consistency?\n> \n> Because asciidoc does not like \\#, '\\#' nor `\\#`. It just shows \\\n> without # and I don't want to master asciidoc just to make it show \\#.\n\nIt works fine for me with asciidoc 8.6.7. <sigh>\n\nI would think the \"inline literal\" syntax started in 8.2.5 would take\ncare of it; maybe there were some bug fixes, considering how new it was\nin your version.\n\nI also think switching \"!\" to `!` is a slight regression; it will change\nfonts in the HTML version, but usually not in the manpage, and the loss\nof the quotes makes things harder to read. I would use both, and it does\nnot hurt to also spell out the name of the punctuation.\n\nSo this:\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 96639e0..c0a5851 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -73,12 +73,15 @@ PATTERN FORMAT\n  - A blank line matches no files, so it can serve as a separator\n    for readability.\n \n- - A line starting with # serves as a comment.\n+ - A line starting with \"`#`\" serves as a comment.\n+   Put a backslash (\"`\\`\") in front of the first hash for the patterns\n+   that start with a hash (i.e., \"`\\#`\").\n \n- - An optional prefix '!' which negates the pattern; any\n+ - An optional prefix \"`!`\" which negates the pattern; any\n    matching file excluded by a previous pattern will become\n    included again.  If a negated pattern matches, this will\n-   override lower precedence patterns sources.\n+   override lower precedence patterns sources. Use \"`\\!`\" if\n+   you need a literal \"`!`\" at the beginning of the pattern.\n \n  - If the pattern ends with a slash, it is removed for the\n    purpose of the following description, but it would only find\n\nrenders to:\n\n       ·   A line starting with \"#\" serves as a comment. Put a\n           backslash (\"\\\") in front of the first hash for the patterns\n           that start with a hash (i.e., \"\\#\").\n\n       ·   An optional prefix \"!\" which negates the pattern; any\n           matching file excluded by a previous pattern will become\n           included again. If a negated pattern matches, this will\n           override lower precedence patterns sources. Use \"\\!\" if you\n           need a literal \"!\" at the beginning of the pattern.\n\n-Peff\n"},{"id":"200666","messageId":"1349531484-5938-1-git-send-email-pclouds@gmail.com","threadId":"31740","inReplyTo":"20121006132127.GC11712@sigill.intra.peff.net","subject":"[PATCH v2] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-06T13:51:24Z","receivedAt":"2012-10-06T13:51:24Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"We support backslash escape, but we hide the details behind the phrase\n\"a shell glob suitable for consumption by fnmatch(3)\". So it may not\nbe obvious how one can get literal # or ! at the beginning of pattern.\nAdd a few lines on how to work around the magic characters.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n On Sat, Oct 6, 2012 at 8:21 PM, Jeff King <peff@peff.net> wrote:\n > It works fine for me with asciidoc 8.6.7. <sigh>\n\n 8.6.5 works. I don't care deeply as I read .txt anyway. Here it goes\n again with examples.\n\n Documentation/gitignore.txt | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 96639e0..0bcf079 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -73,12 +73,16 @@ PATTERN FORMAT\n  - A blank line matches no files, so it can serve as a separator\n    for readability.\n \n- - A line starting with # serves as a comment.\n+ - A line starting with \"`#`\" serves as a comment.\n+   Use \"`\\#`\" instead for patterns that begin with \"`#`\",\n+   for example, \"`\\#backup#.txt`\".\n \n- - An optional prefix '!' which negates the pattern; any\n+ - An optional prefix \"`!`\" which negates the pattern; any\n    matching file excluded by a previous pattern will become\n    included again.  If a negated pattern matches, this will\n    override lower precedence patterns sources.\n+   Use \"`\\!`\" instead for patterns that begin with \"`!`\",\n+   for example, \"`\\!important!.txt`\".\n \n  - If the pattern ends with a slash, it is removed for the\n    purpose of the following description, but it would only find\n-- \n1.7.12.1.406.g6ab07c4\n"},{"id":"200668","messageId":"20121006154036.GA14119@sigill.intra.peff.net","threadId":"31740","inReplyTo":"1349531484-5938-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH v2] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-10-06T15:40:36Z","receivedAt":"2012-10-06T15:40:36Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Oct 06, 2012 at 08:51:24PM +0700, Nguyen Thai Ngoc Duy wrote:\n\n> We support backslash escape, but we hide the details behind the phrase\n> \"a shell glob suitable for consumption by fnmatch(3)\". So it may not\n> be obvious how one can get literal # or ! at the beginning of pattern.\n> Add a few lines on how to work around the magic characters.\n> \n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  On Sat, Oct 6, 2012 at 8:21 PM, Jeff King <peff@peff.net> wrote:\n>  > It works fine for me with asciidoc 8.6.7. <sigh>\n> \n>  8.6.5 works. I don't care deeply as I read .txt anyway. Here it goes\n>  again with examples.\n\nI'd be slightly worried that we are hurting other people who do care and\nare on older versions of asciidoc. It would be nice if we actually knew\nthe cause of the different behaviors we saw and if there was a way to\nwork around it (it might not even be old asciidoc, but rather old\ndocbook).\n\nPart of me wants to just take the change and see if anybody complains.\nBut that is probably the wrong thing to do, and just my general\nfrustration with our doc toolchain talking.\n\n-Peff\n"},{"id":"200678","messageId":"7vr4pbqwz7.fsf@alter.siamese.dyndns.org","threadId":"31740","inReplyTo":"20121006154036.GA14119@sigill.intra.peff.net","subject":"Re: [PATCH v2] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-06T18:25:16Z","receivedAt":"2012-10-06T18:25:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I'd be slightly worried that we are hurting other people who do care and\n> are on older versions of asciidoc. It would be nice if we actually knew\n> the cause of the different behaviors we saw and if there was a way to\n> work around it (it might not even be old asciidoc, but rather old\n> docbook).\n>\n> Part of me wants to just take the change and see if anybody complains.\n> But that is probably the wrong thing to do, and just my general\n> frustration with our doc toolchain talking.\n\nYeah, I do not think we would want to introduce such a regression\nespecially when the proposed update is not the only (or best) way to\ngive us the intended benefit.  I think the \"spell the character name\nout\" approach you showed in the other message was far more readable\nanyway.\n\nThanks.\n"},{"id":"200693","messageId":"1349579634-13521-1-git-send-email-pclouds@gmail.com","threadId":"31740","inReplyTo":"7vr4pbqwz7.fsf@alter.siamese.dyndns.org","subject":"[PATCH v3] gitignore.txt: suggestions how to get literal # or ! at the beginning","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-07T03:13:54Z","receivedAt":"2012-10-07T03:13:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"We support backslash escape, but we hide the details behind the phrase\n\"a shell glob suitable for consumption by fnmatch(3)\". So it may not\nbe obvious how one can get literal # or ! at the beginning of pattern.\nAdd a few lines on how to work around the magic characters.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Back to spelling out, which works with 8.2.6. No examples for \\#\n because '\\' in '\\#example#.txt' is eaten.\n\n Documentation/gitignore.txt | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 96639e0..90106c4 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -74,11 +74,15 @@ PATTERN FORMAT\n    for readability.\n \n  - A line starting with # serves as a comment.\n+   Put a backslash (\"`\\`\") in front of the first hash for patterns\n+   that begin with a hash.\n \n- - An optional prefix '!' which negates the pattern; any\n+ - An optional prefix \"`!`\" which negates the pattern; any\n    matching file excluded by a previous pattern will become\n    included again.  If a negated pattern matches, this will\n    override lower precedence patterns sources.\n+   Put a backslash (\"`\\`\") in front of the first \"`!`\" for patterns\n+   that begin with a literal \"`!`\", for example, \"`\\!important!.txt`\".\n \n  - If the pattern ends with a slash, it is removed for the\n    purpose of the following description, but it would only find\n-- \n1.7.12.1.406.g6ab07c4\n"}]}