3

I've seen posts about using notepad++ and other editors for git, but not one about using PN2.

I've tried variations on the following, but none of them seem to work:

git config --global core.editor "'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w"

I just get errors like the following (this is after "git commit --amend"):

'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 0:
unexpected EOF while looking for matching `''
'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 1:
syntax error: unexpected end of file
error: There was a problem with the editor ''C:\Program Files (x86)\Programmer's
Notepad\pn.exe -allowmulti' -w'.
Please supply the message using either -m or -F option.

Is it possible to get this to work?

Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
user673679
  • 1,327
  • 1
  • 16
  • 35
  • **What** do you want to use PN2 for? In general, git does not need an editor, nor care what you do with it, so what you need to explain is: what do you want to use PN2 for, **exactly**; and where did you use the above command (cmd, powershall, bash) ? – Nevik Rehnel Dec 16 '12 at 13:41
  • 2
    I'm just using windows command line for the command. I want to use pn2 for entering commit messages and interactive rebase. The default git editor using the console seems to break the console. I tried changing to simple notepad (which is what mercurial uses for commit messages windows), but this doesn't work for interactive rebase as it screws up the line endings. – user673679 Dec 16 '12 at 13:48
  • Somehow missed the actual git command. I edited it in. :-/ – user673679 Dec 16 '12 at 13:52

1 Answers1

6

The editor is launched by git using bash scripting. So you should ensure your quoting is for the bash shell. You used single quotes but you have an embedded single quote in the directory name. You should probably also use forward slashes and make it unixy. Seethis answer for an example that uses Notepad++. In your case, I think the following should be ok:

git config --global core.editor "\"C:/Program Files (x86)/Programmer's Notepad/pn.exe\" -allowmulti -w"
Community
  • 1
  • 1
patthoyts
  • 32,320
  • 3
  • 62
  • 93