{"thread":{"id":"25069","subject":"How do I .gitignore files starting with \"#\"?","startedAt":"2010-09-10T16:59:03Z","lastAt":"2010-09-10T20:52:57Z","messageCount":8,"participants":["Bruce Korb","Jakub Narebski","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150454","messageId":"AANLkTimaPrDX4rn2xRYyLn-bh2rB-TgKaEtGSQ+JxSnM@mail.gmail.com","threadId":"25069","inReplyTo":null,"subject":"How do I .gitignore files starting with \"#\"?","fromName":"Bruce Korb","fromEmail":"bruce.korb@gmail.com","sentAt":"2010-09-10T16:59:03Z","receivedAt":"2010-09-10T16:59:03Z","isPatch":false,"sender":{"key":"bruce.korb@gmail.com","avatar":"https://gravatar.com/avatar/86d91467dc7cc8466a9d133a7b93a5d21233052017c144c9a6f6f7e5110344d0?d=mp&s=160"},"body":"After trying lots of variations, I found it to be:\n\n\\#*\n\nNot obvious and not easy to look up.  Please add it to your\n.git/info/exclude sample text.  Thanks!\n"},{"id":"150459","messageId":"m38w39mnyd.fsf@localhost.localdomain","threadId":"25069","inReplyTo":"AANLkTimaPrDX4rn2xRYyLn-bh2rB-TgKaEtGSQ+JxSnM@mail.gmail.com","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-10T18:52:15Z","receivedAt":"2010-09-10T18:52:15Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Bruce Korb <bruce.korb@gmail.com> writes:\n\n> After trying lots of variations, I found it to be:\n> \n> \\#*\n> \n> Not obvious and not easy to look up.  Please add it to your\n> .git/info/exclude sample text.  Thanks!\n\nWell, it is quite obvious to me, as escaping special characters using\nbackslash is typical in Unix tools.  But you are right that this needs\nto be documented.\n\nPerhaps something like this?  I am not sure about example in\n.git/info/exclude skeleton\n\n-- >8 --\nSubject: [PATCH] Document escaping of special characters in gitignore files\n\nRequested-by: Bruce Korb <bruce.korb@gmail.com>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n Documentation/gitignore.txt |    6 ++++++\n templates/info--exclude     |    1 +\n 2 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 7dc2e8b..67ae4d0 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -98,6 +98,12 @@ Patterns have the following format:\n    For example, \"/{asterisk}.c\" matches \"cat-file.c\" but not\n    \"mozilla-sha1/sha1.c\".\n \n+ - You can escape special characters using backslash.\n+   For example, \"{backslash}#*\" matches files beginning in `#`\n+   (otherwise it would be considered comment),\n+   and \"{backslash}!*{backslash}?\" matches files starting with `!`\n+   (negate pattern prefix) and ending with `?` (glob wildcard).\n+\n An example:\n \n --------------------------------------------------------------\ndiff --git a/templates/info--exclude b/templates/info--exclude\nindex a5196d1..2ebaf0d 100644\n--- a/templates/info--exclude\n+++ b/templates/info--exclude\n@@ -4,3 +4,4 @@\n # exclude patterns (uncomment them if you want to use them):\n # *.[oa]\n # *~\n+# \\#*#\n-- \n1.7.2.1\n"},{"id":"150461","messageId":"AANLkTimw5pzdGjiPps-CE1PJS1sBXYw3dE4vhdwm1CYP@mail.gmail.com","threadId":"25069","inReplyTo":"m38w39mnyd.fsf@localhost.localdomain","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-10T18:59:43Z","receivedAt":"2010-09-10T18:59:43Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Sep 10, 2010 at 18:52, Jakub Narebski <jnareb@gmail.com> wrote:\n> Bruce Korb <bruce.korb@gmail.com> writes:\n>\n>> After trying lots of variations, I found it to be:\n>>\n>> \\#*\n>>\n>> Not obvious and not easy to look up.  Please add it to your\n>> .git/info/exclude sample text.  Thanks!\n>\n> Well, it is quite obvious to me, as escaping special characters using\n> backslash is typical in Unix tools.  But you are right that this needs\n> to be documented.\n>\n> Perhaps something like this?  I am not sure about example in\n> .git/info/exclude skeleton\n>\n> -- >8 --\n> Subject: [PATCH] Document escaping of special characters in gitignore files\n>\n> Requested-by: Bruce Korb <bruce.korb@gmail.com>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> ---\n>  Documentation/gitignore.txt |    6 ++++++\n>  templates/info--exclude     |    1 +\n>  2 files changed, 7 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\n> index 7dc2e8b..67ae4d0 100644\n> --- a/Documentation/gitignore.txt\n> +++ b/Documentation/gitignore.txt\n> @@ -98,6 +98,12 @@ Patterns have the following format:\n>    For example, \"/{asterisk}.c\" matches \"cat-file.c\" but not\n>    \"mozilla-sha1/sha1.c\".\n>\n> + - You can escape special characters using backslash.\n> +   For example, \"{backslash}#*\" matches files beginning in `#`\n> +   (otherwise it would be considered comment),\n> +   and \"{backslash}!*{backslash}?\" matches files starting with `!`\n> +   (negate pattern prefix) and ending with `?` (glob wildcard).\n> +\n\nMaybe fix this too in the same manpage:\n\n    A line starting with # serves as a comment.\n\nTo:\n\n    A line starting with # serves as a comment. Use \\# for a literal #\ncharacter. See ...\n"},{"id":"150463","messageId":"AANLkTi=D2M-QrbLodunphy+KJYt7eyfWsgzbwcBSZNyS@mail.gmail.com","threadId":"25069","inReplyTo":"AANLkTimw5pzdGjiPps-CE1PJS1sBXYw3dE4vhdwm1CYP@mail.gmail.com","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Bruce Korb","fromEmail":"bruce.korb@gmail.com","sentAt":"2010-09-10T19:11:22Z","receivedAt":"2010-09-10T19:11:22Z","isPatch":false,"sender":{"key":"bruce.korb@gmail.com","avatar":"https://gravatar.com/avatar/86d91467dc7cc8466a9d133a7b93a5d21233052017c144c9a6f6f7e5110344d0?d=mp&s=160"},"body":"On Fri, Sep 10, 2010 at 11:59 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> On Fri, Sep 10, 2010 at 18:52, Jakub Narebski <jnareb@gmail.com> wrote:\n>> Bruce Korb <bruce.korb@gmail.com> writes:\n>>\n>>> After trying lots of variations, I found it to be:\n>>>\n>>> \\#*\n>>>\n>>> Not obvious and not easy to look up.  Please add it to your\n>>> .git/info/exclude sample text.  Thanks!\n>>\n>> Well, it is quite obvious to me, as escaping special characters using\n>> backslash is typical in Unix tools.\n\nLike cscope, for example?\n\n  \"#what ever\"\n\nOthers use:\n\n   ./#whatever\n\n/etc/fstab requires \\octal escapes, and not \\xFF.\n\nThere are many unix standards to choose from, hence my suggestion. :)\nThat backslashes are sometimes used meant I found it before  pressing\n\"send\".\n"},{"id":"150466","messageId":"201009102133.19427.jnareb@gmail.com","threadId":"25069","inReplyTo":"AANLkTimw5pzdGjiPps-CE1PJS1sBXYw3dE4vhdwm1CYP@mail.gmail.com","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-10T19:33:17Z","receivedAt":"2010-09-10T19:33:17Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, 10 Sep 2010, Ævar Arnfjörð Bjarmason wrote:\n> On Fri, Sep 10, 2010 at 18:52, Jakub Narebski <jnareb@gmail.com> wrote:\n> > Bruce Korb <bruce.korb@gmail.com> writes:\n> >\n> > > After trying lots of variations, I found it to be:\n> > >\n> > > \\#*\n> > >\n> > > Not obvious and not easy to look up.  Please add it to your\n> > > .git/info/exclude sample text.  Thanks!\n> >\n> > Well, it is quite obvious to me, as escaping special characters using\n> > backslash is typical in Unix tools.  But you are right that this needs\n> > to be documented.\n> >\n> > Perhaps something like this?  I am not sure about example in\n> > .git/info/exclude skeleton\n> >\n> > -- >8 --\n> > Subject: [PATCH] Document escaping of special characters in gitignore files\n> >\n> > Requested-by: Bruce Korb <bruce.korb@gmail.com>\n> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> > ---\n> >  Documentation/gitignore.txt |    6 ++++++\n> >  templates/info--exclude     |    1 +\n> >  2 files changed, 7 insertions(+), 0 deletions(-)\n> >\n> > diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\n> > index 7dc2e8b..67ae4d0 100644\n> > --- a/Documentation/gitignore.txt\n> > +++ b/Documentation/gitignore.txt\n> > @@ -98,6 +98,12 @@ Patterns have the following format:\n> >    For example, \"/{asterisk}.c\" matches \"cat-file.c\" but not\n> >    \"mozilla-sha1/sha1.c\".\n> >\n> > + - You can escape special characters using backslash.\n> > +   For example, \"{backslash}#*\" matches files beginning in `#`\n> > +   (otherwise it would be considered comment),\n> > +   and \"{backslash}!*{backslash}?\" matches files starting with `!`\n> > +   (negate pattern prefix) and ending with `?` (glob wildcard).\n> > +\n> \n> Maybe fix this too in the same manpage:\n> \n>     A line starting with # serves as a comment.\n> \n> To:\n> \n>     A line starting with # serves as a comment. Use \\# for a literal #\n> character. See ...\n\nSomething like this?\n-- >8 --\nSubject: [PATCH] Document escaping of special characters in gitignore files\n\nRequested-by: Bruce Korb <bruce.korb@gmail.com>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n Documentation/gitignore.txt |    6 ++++++\n templates/info--exclude     |    1 +\n 2 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 7dc2e8b..67ae4d0 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -98,6 +98,12 @@ Patterns have the following format:\n    For example, \"/{asterisk}.c\" matches \"cat-file.c\" but not\n    \"mozilla-sha1/sha1.c\".\n \n+ - You can escape special characters using backslash.\n+   For example, \"{backslash}#*\" matches files beginning in `#`\n+   (otherwise it would be considered comment),\n+   and \"{backslash}!*{backslash}?\" matches files starting with `!`\n+   (negate pattern prefix) and ending with `?` (glob wildcard).\n+\n An example:\n \n --------------------------------------------------------------\ndiff --git a/templates/info--exclude b/templates/info--exclude\nindex a5196d1..2ebaf0d 100644\n--- a/templates/info--exclude\n+++ b/templates/info--exclude\n@@ -4,3 +4,4 @@\n # exclude patterns (uncomment them if you want to use them):\n # *.[oa]\n # *~\n+# \\#*#\n-- \n1.7.2.1\n"},{"id":"150473","messageId":"201009102141.30416.jnareb@gmail.com","threadId":"25069","inReplyTo":"AANLkTi=D2M-QrbLodunphy+KJYt7eyfWsgzbwcBSZNyS@mail.gmail.com","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-10T19:41:29Z","receivedAt":"2010-09-10T19:41:29Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Bruce Korb wrote:\n> On Fri, Sep 10, 2010 at 11:59 AM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> On Fri, Sep 10, 2010 at 18:52, Jakub Narebski <jnareb@gmail.com> wrote:\n>>> Bruce Korb <bruce.korb@gmail.com> writes:\n>>>\n>>>> After trying lots of variations, I found it to be:\n>>>>\n>>>> \\#*\n>>>>\n>>>> Not obvious and not easy to look up.  Please add it to your\n>>>> .git/info/exclude sample text.  Thanks!\n>>>\n>>> Well, it is quite obvious to me, as escaping special characters using\n>>> backslash is typical in Unix tools.\n> \n> Like cscope, for example?\n> \n>   \"#what ever\"\n> \n> Others use:\n> \n>    ./#whatever\n\nActually \"/#whatever\" would also work, but it would have different meaning,\nanchoring filename so only files in given directory matches.\n\n> \n> /etc/fstab requires \\octal escapes, and not \\xFF.\n\nThey are not escapes, but quoting of metacharacters (special characters).\n\n> \n> There are many unix standards to choose from, hence my suggestion. :)\n> That backslashes are sometimes used meant I found it before  pressing\n> \"send\".\n\n:-)\n\n-- \nJakub Narebski\nPoland\n"},{"id":"150474","messageId":"201009102156.31439.jnareb@gmail.com","threadId":"25069","inReplyTo":"201009102133.19427.jnareb@gmail.com","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-10T19:56:29Z","receivedAt":"2010-09-10T19:56:29Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jakub Narebski wrote:\n\n> Something like this?\n\nErr, rather like this.\n-- >8 --\nSubject: [PATCH] Document escaping of special characters in gitignore files\n\nRequested-by: Bruce Korb <bruce.korb@gmail.com>\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n Documentation/gitignore.txt |    7 +++++++\n templates/info--exclude     |    1 +\n 2 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\nindex 7dc2e8b..20abc20 100644\n--- a/Documentation/gitignore.txt\n+++ b/Documentation/gitignore.txt\n@@ -68,6 +68,7 @@ Patterns have the following format:\n    for readability.\n \n  - A line starting with # serves as a comment.\n+   Use `\\#` for a literal # character starting filename.\n \n  - An optional prefix '!' which negates the pattern; any\n    matching file excluded by a previous pattern will become\n@@ -98,6 +99,12 @@ Patterns have the following format:\n    For example, \"/{asterisk}.c\" matches \"cat-file.c\" but not\n    \"mozilla-sha1/sha1.c\".\n \n+ - You can escape special characters using backslash.\n+   For example, \"{backslash}#*\" matches files beginning in `#`\n+   (otherwise it would be considered comment),\n+   and \"{backslash}!*{backslash}?\" matches files starting with `!`\n+   (negate pattern prefix) and ending with `?` (glob wildcard).\n+\n An example:\n \n --------------------------------------------------------------\ndiff --git a/templates/info--exclude b/templates/info--exclude\nindex a5196d1..2ebaf0d 100644\n--- a/templates/info--exclude\n+++ b/templates/info--exclude\n@@ -4,3 +4,4 @@\n # exclude patterns (uncomment them if you want to use them):\n # *.[oa]\n # *~\n+# \\#*#\n-- \n1.7.2.1\n"},{"id":"150476","messageId":"AANLkTim4+_GWdnzEGsiqwbySN7uy+7MgwnCYXWiVgjqQ@mail.gmail.com","threadId":"25069","inReplyTo":"201009102156.31439.jnareb@gmail.com","subject":"Re: How do I .gitignore files starting with \"#\"?","fromName":"Bruce Korb","fromEmail":"bruce.korb@gmail.com","sentAt":"2010-09-10T20:52:57Z","receivedAt":"2010-09-10T20:52:57Z","isPatch":false,"sender":{"key":"bruce.korb@gmail.com","avatar":"https://gravatar.com/avatar/86d91467dc7cc8466a9d133a7b93a5d21233052017c144c9a6f6f7e5110344d0?d=mp&s=160"},"body":"On Fri, Sep 10, 2010 at 12:56 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> Jakub Narebski wrote:\n>\n>> Something like this?\n\n> diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt\n> index 7dc2e8b..20abc20 100644\n> --- a/Documentation/gitignore.txt\n\nI think the prototype for info/exclude is a good idea, too.\n\n>> /etc/fstab requires \\octal escapes, and not \\xFF.\n>\n> They are not escapes, but quoting of metacharacters (special characters).\n\n./#\n\\#\n\"#\"\n\\043\n\\x23\n&35;\n\nwhatever you care to call it, however you spell it, the result is intended to be\nthe same:  This sequence of characters is to be interpreted as part of the token\nand not special annotation (or token separator) characters.\n\nAnyway, thanks for fixing the doc.  - Bruce\n"}]}