{"thread":{"id":"42435","subject":"[BUG] can not escape sharps in git config file","startedAt":"2016-05-24T10:14:42Z","lastAt":"2016-05-25T05:11:58Z","messageCount":4,"participants":["Jean-Noël Avila","Torsten Bögershausen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"287403","messageId":"57442992.6030306@gmail.com","threadId":"42435","inReplyTo":null,"subject":"[BUG] can not escape sharps in git config file","fromName":"Jean-Noël Avila","fromEmail":"avila.jn@gmail.com","sentAt":"2016-05-24T10:14:42Z","receivedAt":"2016-05-24T10:14:42Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Hi everyone,\n\nI stumbled on this:\n\nconfig file:\n\n[filter \"kicad_sch\"]\n        clean = sed -E 's/#(PWR|FLG)[0-9]+/#\\1?/'\n        smudge = cat\n\n\nThen in the shell:\n\n± git add -u\nsed -E 's/: 1: sed -E 's/: Syntax error: Unterminated quoted string\nerror: external filter sed -E 's/ failed 2\nerror: external filter sed -E 's/ failed\n\nIt seems that the  # is used for end-of-line comments and can not be\nescaped, even in quotes or backslash.\n\nJN\n"},{"id":"287404","messageId":"57442C2A.3010202@gmail.com","threadId":"42435","inReplyTo":"57442992.6030306@gmail.com","subject":"Re: [BUG] can not escape sharps in git config file","fromName":"Jean-Noël Avila","fromEmail":"avila.jn@gmail.com","sentAt":"2016-05-24T10:25:46Z","receivedAt":"2016-05-24T10:25:46Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Forgot to add:\n\n± git --version\ngit version 2.8.3\n"},{"id":"287407","messageId":"574439B3.9090308@gmail.com","threadId":"42435","inReplyTo":"57442992.6030306@gmail.com","subject":"Re: [BUG] can not escape sharps in git config file","fromName":"Jean-Noël Avila","fromEmail":"avila.jn@gmail.com","sentAt":"2016-05-24T11:23:31Z","receivedAt":"2016-05-24T11:23:31Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"My mistake, sorry for the noise,\n\nJFTR:\n\n * only double quotes can fully escape a string (it is safer to enclose\nthe whole value in double quotes)\n * backslashes have to be doubled because they are interpreted by git\n\nSo\n\n[filter \"kicad_sch\"]\n    clean = \"sed -E 's/#(PWR|FLG)[0-9]+/#\\\\1?/'\"\n    smudge = cat\n\nJN\n"},{"id":"287479","messageId":"5745341E.4080305@web.de","threadId":"42435","inReplyTo":"574439B3.9090308@gmail.com","subject":"Re: [BUG] can not escape sharps in git config file","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2016-05-25T05:11:58Z","receivedAt":"2016-05-25T05:11:58Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 05/24/2016 01:23 PM, Jean-Noël Avila wrote:\n> My mistake, sorry for the noise,\n>\n> JFTR:\n>\n>   * only double quotes can fully escape a string (it is safer to enclose\n> the whole value in double quotes)\n>   * backslashes have to be doubled because they are interpreted by git\n>\n> So\n>\n> [filter \"kicad_sch\"]\n>      clean = \"sed -E 's/#(PWR|FLG)[0-9]+/#\\\\1?/'\"\n>      smudge = cat\n>\n(I'm not a filter expert)\nWhat happens if you put the sed expression into a shell script, and\nconfigure the filter to call the script instead ?\n"}]}