git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] can not escape sharps in git config file
@ 2016-05-24 10:14 Jean-Noël Avila
  2016-05-24 10:25 ` Jean-Noël Avila
  2016-05-24 11:23 ` Jean-Noël Avila
  0 siblings, 2 replies; 4+ messages in thread
From: Jean-Noël Avila @ 2016-05-24 10:14 UTC (permalink / raw)
  To: git

Hi everyone,

I stumbled on this:

config file:

[filter "kicad_sch"]
        clean = sed -E 's/#(PWR|FLG)[0-9]+/#\1?/'
        smudge = cat


Then in the shell:

± git add -u
sed -E 's/: 1: sed -E 's/: Syntax error: Unterminated quoted string
error: external filter sed -E 's/ failed 2
error: external filter sed -E 's/ failed

It seems that the  # is used for end-of-line comments and can not be
escaped, even in quotes or backslash.

JN

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] can not escape sharps in git config file
  2016-05-24 10:14 [BUG] can not escape sharps in git config file Jean-Noël Avila
@ 2016-05-24 10:25 ` Jean-Noël Avila
  2016-05-24 11:23 ` Jean-Noël Avila
  1 sibling, 0 replies; 4+ messages in thread
From: Jean-Noël Avila @ 2016-05-24 10:25 UTC (permalink / raw)
  To: git

Forgot to add:

± git --version
git version 2.8.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] can not escape sharps in git config file
  2016-05-24 10:14 [BUG] can not escape sharps in git config file Jean-Noël Avila
  2016-05-24 10:25 ` Jean-Noël Avila
@ 2016-05-24 11:23 ` Jean-Noël Avila
  2016-05-25  5:11   ` Torsten Bögershausen
  1 sibling, 1 reply; 4+ messages in thread
From: Jean-Noël Avila @ 2016-05-24 11:23 UTC (permalink / raw)
  To: git

My mistake, sorry for the noise,

JFTR:

 * only double quotes can fully escape a string (it is safer to enclose
the whole value in double quotes)
 * backslashes have to be doubled because they are interpreted by git

So

[filter "kicad_sch"]
    clean = "sed -E 's/#(PWR|FLG)[0-9]+/#\\1?/'"
    smudge = cat

JN

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] can not escape sharps in git config file
  2016-05-24 11:23 ` Jean-Noël Avila
@ 2016-05-25  5:11   ` Torsten Bögershausen
  0 siblings, 0 replies; 4+ messages in thread
From: Torsten Bögershausen @ 2016-05-25  5:11 UTC (permalink / raw)
  To: Jean-Noël Avila, git

On 05/24/2016 01:23 PM, Jean-Noël Avila wrote:
> My mistake, sorry for the noise,
>
> JFTR:
>
>   * only double quotes can fully escape a string (it is safer to enclose
> the whole value in double quotes)
>   * backslashes have to be doubled because they are interpreted by git
>
> So
>
> [filter "kicad_sch"]
>      clean = "sed -E 's/#(PWR|FLG)[0-9]+/#\\1?/'"
>      smudge = cat
>
(I'm not a filter expert)
What happens if you put the sed expression into a shell script, and
configure the filter to call the script instead ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-25  5:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 10:14 [BUG] can not escape sharps in git config file Jean-Noël Avila
2016-05-24 10:25 ` Jean-Noël Avila
2016-05-24 11:23 ` Jean-Noël Avila
2016-05-25  5:11   ` Torsten Bögershausen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).