{"thread":{"id":"38024","subject":"Cannot set the commit-message editor","startedAt":"2014-11-21T15:57:17Z","lastAt":"2014-11-21T19:57:22Z","messageCount":4,"participants":["Fahad Ashfaque","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252345","messageId":"CAOmRNZ4uJEoxroyCRUSDwSC3OAMKTSO0s91_uFDaUit3k8eJLg@mail.gmail.com","threadId":"38024","inReplyTo":null,"subject":"Cannot set the commit-message editor","fromName":"Fahad Ashfaque","fromEmail":"fahadash@gmail.com","sentAt":"2014-11-21T15:57:17Z","receivedAt":"2014-11-21T15:57:17Z","isPatch":false,"sender":{"key":"fahadash@gmail.com","avatar":null},"body":"I have downloaded the latest git from git-scm on my windows machine.\n\nI am using git on windows, I am having trouble trying to get notepad++\nas my commit message editor.\n\nI have created a shell script called npp.sh which has the following content\n\n/c/Program\\ Files\\ \\(x86\\)/Notepad++/notepad++.exe -multiInst\n-nosession -noPlugin $1\n\n\nI figured this is how paths are accepted in git-bash\n\nNow I configured core.editor this way\n\ngit config --global core.editor /c/path/to/npp.sh\n\n\nwhen I try to commit, using the following command\n\ngit commit\n\nI get the following error\n$ git commit\nerror: cannot spawn c:/path/to/npp.sh: No such file or directory\nerror: unable to start editor 'c:/dev/tools/cmd/npp.sh'\nPlease supply the message using either -m or -F option.\n\nwhen I run the following command\n\nls c:/\n\nI get the directory for my repository's root, not C drive's root\n\nWhen I run the following command through git-bash\n\n/c/path/to/npp.sh\n\nIt works\n\nbut when git commit invokes, it does not.\n\nHere is more of what I found\n\nwhen 'git commit' launches npp.sh, it changes /c/path/to/npp.sh to\nc:/path/to/npp.sh\n\nc:/ is not the root of my C drive according to git-bash, c:/ is root\nof my repository because when I run 'ls c:/' I get files from root of\nmy repository.\n\nso may be if 'git commit' does not change /c/path/to/npp.sh to\nc:/path/to/npp.sh, it would work... Or if git-bash does not mount c:/\nto /c/path/to/myrepository and keep it to /c it would work too.\n\nPlease let me know if you need more info on this\n\nThanks\n\nFahad\n"},{"id":"252349","messageId":"F248C92A32904678A4E8E158A3518AA3@PhilipOakley","threadId":"38024","inReplyTo":"CAOmRNZ4uJEoxroyCRUSDwSC3OAMKTSO0s91_uFDaUit3k8eJLg@mail.gmail.com","subject":"Re: Cannot set the commit-message editor","fromName":"Philip Oakley","fromEmail":"philipoakley-7kbabnvhqfm@public.gmane.org","sentAt":null,"receivedAt":"2014-11-21T17:33:08Z","isPatch":false,"sender":{"key":"philipoakley-7kbabnvhqfm@public.gmane.org","avatar":null},"body":"From: \"Fahad Ashfaque\" <fahadash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>\n>I have downloaded the latest git from git-scm on my windows machine.\n>\n> I am using git on windows, I am having trouble trying to get notepad++\n> as my commit message editor.\n>\n> I have created a shell script called npp.sh which has the following \n> content\n>\n> /c/Program\\ Files\\ \\(x86\\)/Notepad++/notepad++.exe -multiInst\n> -nosession -noPlugin $1\n>\n>\n> I figured this is how paths are accepted in git-bash\n>\n> Now I configured core.editor this way\n>\n> git config --global core.editor /c/path/to/npp.sh\n>\n\nI simply have (from 'git config -l'):\ncore.editor='C:/Program \nFiles/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noplugin\n\n>\n> when I try to commit, using the following command\n>\n> git commit\n>\n> I get the following error\n> $ git commit\n> error: cannot spawn c:/path/to/npp.sh: No such file or directory\n> error: unable to start editor 'c:/dev/tools/cmd/npp.sh'\n> Please supply the message using either -m or -F option.\n>\n> when I run the following command\n>\n> ls c:/\n>\n> I get the directory for my repository's root, not C drive's root\n>\n> When I run the following command through git-bash\n>\n> /c/path/to/npp.sh\n>\n> It works\n>\n> but when git commit invokes, it does not.\n>\n> Here is more of what I found\n>\n> when 'git commit' launches npp.sh, it changes /c/path/to/npp.sh to\n> c:/path/to/npp.sh\n>\n> c:/ is not the root of my C drive according to git-bash,\nCorrect. The \"Linux\" bash is rooted, _usually_, at the base of your \npersonal 'c:/documents and settings' (or whatever on your Windows \nversion), with the MS drives under /c/ and /d/ etc. i.e. a load of \nvirtualisation.\n\nuse 'pwd -W' to get the true (Windows) path of your current/present \nworking directory. (I had to ask just a few days ago ;-)\n\n> c:/ is root\n> of my repository because when I run 'ls c:/' I get files from root of\n> my repository.\nI wouldn't have expected that to play nice (confusion between windows \nand linux path styles).\n\n>\n> so may be if 'git commit' does not change /c/path/to/npp.sh to\n> c:/path/to/npp.sh, it would work... Or if git-bash does not mount c:/\n> to /c/path/to/myrepository and keep it to /c it would work too.\n>\n> Please let me know if you need more info on this\n\nI've also copied in the Git user / Git for Human beings list (for \nreference) which can be useful for Windows based issues.\n\n>\n> Thanks\n>\n> Fahad\n> --\n\n-- \nYou received this message because you are subscribed to the Google Groups \"Git for human beings\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"252361","messageId":"CAOmRNZ5PGWNM_+c_G_3ZfBnYqXTM-5WRBpK_z7Px6Jkae+CvRw@mail.gmail.com","threadId":"38024","inReplyTo":"F248C92A32904678A4E8E158A3518AA3@PhilipOakley","subject":"Re: Cannot set the commit-message editor","fromName":"Fahad Ashfaque","fromEmail":"fahadash@gmail.com","sentAt":"2014-11-21T19:51:23Z","receivedAt":"2014-11-21T19:51:23Z","isPatch":false,"sender":{"key":"fahadash@gmail.com","avatar":null},"body":"still don't get it.\n\nI run /c/path/to/npp.sh just fine,.... Its only 'git commit' that is\nteleporting me to a different world. So there is NO way I can refer to\nfolders outside of my repository in a shell script when it is used in\na config param ?\n\nI will try setting the core.editor to the value you suggested.\n\nOn Fri, Nov 21, 2014 at 12:48 PM, Philip Oakley <philipoakley@iee.org> wrote:\n> From: \"Fahad Ashfaque\" <fahadash@gmail.com>\n>>\n>> I have downloaded the latest git from git-scm on my windows machine.\n>>\n>> I am using git on windows, I am having trouble trying to get notepad++\n>> as my commit message editor.\n>>\n>> I have created a shell script called npp.sh which has the following\n>> content\n>>\n>> /c/Program\\ Files\\ \\(x86\\)/Notepad++/notepad++.exe -multiInst\n>> -nosession -noPlugin $1\n>>\n>>\n>> I figured this is how paths are accepted in git-bash\n>>\n>> Now I configured core.editor this way\n>>\n>> git config --global core.editor /c/path/to/npp.sh\n>>\n>\n> I simply have (from 'git config -l'):\n> core.editor='C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar\n> -nosession -noplugin\n>\n>>\n>> when I try to commit, using the following command\n>>\n>> git commit\n>>\n>> I get the following error\n>> $ git commit\n>> error: cannot spawn c:/path/to/npp.sh: No such file or directory\n>> error: unable to start editor 'c:/dev/tools/cmd/npp.sh'\n>> Please supply the message using either -m or -F option.\n>>\n>> when I run the following command\n>>\n>> ls c:/\n>>\n>> I get the directory for my repository's root, not C drive's root\n>>\n>> When I run the following command through git-bash\n>>\n>> /c/path/to/npp.sh\n>>\n>> It works\n>>\n>> but when git commit invokes, it does not.\n>>\n>> Here is more of what I found\n>>\n>> when 'git commit' launches npp.sh, it changes /c/path/to/npp.sh to\n>> c:/path/to/npp.sh\n>>\n>> c:/ is not the root of my C drive according to git-bash,\n>\n> Correct. The \"Linux\" bash is rooted, _usually_, at the base of your personal\n> 'c:/documents and settings' (or whatever on your Windows version), with the\n> MS drives under /c/ and /d/ etc. i.e. a load of virtualisation.\n>\n> use 'pwd -W' to get the true (Windows) path of your current/present working\n> directory. (I had to ask just a few days ago ;-)\n>\n>> c:/ is root\n>> of my repository because when I run 'ls c:/' I get files from root of\n>> my repository.\n>\n> I wouldn't have expected that to play nice (confusion between windows and\n> linux path styles).\n>\n>>\n>> so may be if 'git commit' does not change /c/path/to/npp.sh to\n>> c:/path/to/npp.sh, it would work... Or if git-bash does not mount c:/\n>> to /c/path/to/myrepository and keep it to /c it would work too.\n>>\n>> Please let me know if you need more info on this\n>\n>\n> I've also copied in the Git user / Git for Human beings list (for reference)\n> which can be useful for Windows based issues.\n>\n>>\n>> Thanks\n>>\n>> Fahad\n>> --\n>\n>\n"},{"id":"252367","messageId":"ADA906CC4DD040DF9F1F2DFA9EEF69BF@PhilipOakley","threadId":"38024","inReplyTo":"CAOmRNZ5PGWNM_+c_G_3ZfBnYqXTM-5WRBpK_z7Px6Jkae+CvRw@mail.gmail.com","subject":"Re: Cannot set the commit-message editor","fromName":"Philip Oakley","fromEmail":"philipoakley-7kbabnvhqfm@public.gmane.org","sentAt":null,"receivedAt":"2014-11-21T19:57:22Z","isPatch":false,"sender":{"key":"philipoakley-7kbabnvhqfm@public.gmane.org","avatar":null},"body":"From: \"Fahad Ashfaque\" <fahadash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>\n> still don't get it.\n>\n\nDo check each instance of bash separately. Each can have a different \nvirtual root.\n\nI was caught by this just last week on Msysgit (the msys.bat) where that \nhas a different base address to the Git bash version in \"C:\\program \nfiles\".\nhttps://groups.google.com/d/msg/msysgit/prLaAOCF9Ig/l1zRsYfVrqwJ\n\n> I run /c/path/to/npp.sh just fine,.... Its only 'git commit' that is\n> teleporting me to a different world. So there is NO way I can refer to\n> folders outside of my repository in a shell script when it is used in\n> a config param ?\n>\n> I will try setting the core.editor to the value you suggested.\n>\n> On Fri, Nov 21, 2014 at 12:48 PM, Philip Oakley <philipoakley-7KbaBNvhQFM@public.gmane.org> \n> wrote:\n>> From: \"Fahad Ashfaque\" <fahadash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>\n>>>\n>>> I have downloaded the latest git from git-scm on my windows machine.\n>>>\n>>> I am using git on windows, I am having trouble trying to get \n>>> notepad++\n>>> as my commit message editor.\n>>>\n>>> I have created a shell script called npp.sh which has the following\n>>> content\n>>>\n>>> /c/Program\\ Files\\ \\(x86\\)/Notepad++/notepad++.exe -multiInst\n>>> -nosession -noPlugin $1\n>>>\n>>>\n>>> I figured this is how paths are accepted in git-bash\n>>>\n>>> Now I configured core.editor this way\n>>>\n>>> git config --global core.editor /c/path/to/npp.sh\n>>>\n>>\n>> I simply have (from 'git config -l'):\n>> core.editor='C:/Program \n>> Files/Notepad++/notepad++.exe' -multiInst -notabbar\n>> -nosession -noplugin\n>>\n>>>\n>>> when I try to commit, using the following command\n>>>\n>>> git commit\n>>>\n>>> I get the following error\n>>> $ git commit\n>>> error: cannot spawn c:/path/to/npp.sh: No such file or directory\n>>> error: unable to start editor 'c:/dev/tools/cmd/npp.sh'\n>>> Please supply the message using either -m or -F option.\n>>>\n>>> when I run the following command\n>>>\n>>> ls c:/\n>>>\n>>> I get the directory for my repository's root, not C drive's root\n>>>\n>>> When I run the following command through git-bash\n>>>\n>>> /c/path/to/npp.sh\n>>>\n>>> It works\n>>>\n>>> but when git commit invokes, it does not.\n>>>\n>>> Here is more of what I found\n>>>\n>>> when 'git commit' launches npp.sh, it changes /c/path/to/npp.sh to\n>>> c:/path/to/npp.sh\n>>>\n>>> c:/ is not the root of my C drive according to git-bash,\n>>\n>> Correct. The \"Linux\" bash is rooted, _usually_, at the base of your \n>> personal\n>> 'c:/documents and settings' (or whatever on your Windows version), \n>> with the\n>> MS drives under /c/ and /d/ etc. i.e. a load of virtualisation.\n>>\n>> use 'pwd -W' to get the true (Windows) path of your current/present \n>> working\n>> directory. (I had to ask just a few days ago ;-)\n>>\n>>> c:/ is root\n>>> of my repository because when I run 'ls c:/' I get files from root \n>>> of\n>>> my repository.\n>>\n>> I wouldn't have expected that to play nice (confusion between windows \n>> and\n>> linux path styles).\n>>\n>>>\n>>> so may be if 'git commit' does not change /c/path/to/npp.sh to\n>>> c:/path/to/npp.sh, it would work... Or if git-bash does not mount \n>>> c:/\n>>> to /c/path/to/myrepository and keep it to /c it would work too.\n>>>\n>>> Please let me know if you need more info on this\n>>\n>>\n>> I've also copied in the Git user / Git for Human beings list (for \n>> reference)\n>> which can be useful for Windows based issues.\n>>\n>>>\n>>> Thanks\n>>>\n>>> Fahad\n>>> --\n>>\n>>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n\n-- \nYou received this message because you are subscribed to the Google Groups \"Git for human beings\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org\nFor more options, visit https://groups.google.com/d/optout.\n"}]}