git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Cannot set the commit-message editor

From
FAFahad Ashfaque <fahadash@gmail.com>
Date
Nov 21, 2014, 15:57 UTC
Message-ID
<CAOmRNZ4uJEoxroyCRUSDwSC3OAMKTSO0s91_uFDaUit3k8eJLg@mail.gmail.com>
I have downloaded the latest git from git-scm on my windows machine.

I am using git on windows, I am having trouble trying to get notepad++ as my commit message editor.

I have created a shell script called npp.sh which has the following content

/c/Program\ Files\ \(x86\)/Notepad++/notepad++.exe -multiInst -nosession -noPlugin $1

I figured this is how paths are accepted in git-bash
Now I configured core.editor this way
git config --global core.editor /c/path/to/npp.sh
when I try to commit, using the following command
git commit

I get the following error $ git commit error: cannot spawn c:/path/to/npp.sh: No such file or directory error: unable to start editor 'c:/dev/tools/cmd/npp.sh' Please supply the message using either -m or -F option.

when I run the following command
ls c:/
I get the directory for my repository's root, not C drive's root
When I run the following command through git-bash
/c/path/to/npp.sh
It works
but when git commit invokes, it does not.
Here is more of what I found

when 'git commit' launches npp.sh, it changes /c/path/to/npp.sh to c:/path/to/npp.sh

c:/ is not the root of my C drive according to git-bash, c:/ is root of my repository because when I run 'ls c:/' I get files from root of my repository.

so may be if 'git commit' does not change /c/path/to/npp.sh to c:/path/to/npp.sh, it would work... Or if git-bash does not mount c:/ to /c/path/to/myrepository and keep it to /c it would work too.

Please let me know if you need more info on this
Thanks
Fahad
Next: Philip Oakley
Message 1 of 4 in “Cannot set the commit-message editor”
  1. Fahad AshfaqueNov 21, 2014
  2. Philip OakleyNov 21, 2014
  3. Fahad AshfaqueNov 21, 2014
  4. Philip OakleyNov 21, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.