Re: Escape character for .gitconfig
- From
Jeff King <peff@peff.net>
- Date
- Dec 17, 2011, 10:58 UTC
- Message-ID
- <20111217105806.GB23935@sigill.intra.peff.net>
- In-Reply-To
- <4EEC6A9D.1060005@icefield.yk.ca>
On Sat, Dec 17, 2011 at 11:10:37AM +0100, Erik Blake wrote:
Show 14 quoted lines
> I have an editor path that includes "(" and ")". No matter how I try
> to escape this character, I get either variations on:
>
> C:/Program Files (x86)/Notepad++/notepad++.exe: -c: line 0: syntax
> error near unexpected token `('
> C:/Program Files (x86)/Notepad++/notepad++.exe: -c: line 0:
> `C:/Program Files (x86)/Notepad++/notepad++.exe \$@\'
> error: There was a problem with the editor 'C:/Program Files
> (x86)/Notepad++/notepad++.exe'.
> Please supply the message using either -m or -F option.
>
> or:
>
> fatal: bad config file line 5 in C:\Users\xxx/.gitconfigYou didn't tell us what you actually tried, so I don't know where you went wrong.
But you will need to quote the whole value for git to read from your gitconfig, and then quote any metacharacters in the value so that the shell doesn't interpret them. I think you want:
[core]
editor = "'C:/Program Files (x86)/Notepad++/notepad++.exe'"-Peff