git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Cannot set the commit-message editor
@ 2014-11-21 15:57 Fahad Ashfaque
  2014-11-21 17:48 ` Philip Oakley
  0 siblings, 1 reply; 4+ messages in thread
From: Fahad Ashfaque @ 2014-11-21 15:57 UTC (permalink / raw)
  To: git

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

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

* Re: Cannot set the commit-message editor
  2014-11-21 15:57 Cannot set the commit-message editor Fahad Ashfaque
@ 2014-11-21 17:48 ` Philip Oakley
  2014-11-21 19:51   ` Fahad Ashfaque
  0 siblings, 1 reply; 4+ messages in thread
From: Philip Oakley @ 2014-11-21 17:48 UTC (permalink / raw)
  To: Fahad Ashfaque, git-u79uwXL29TY76Z2rM5mHXA; +Cc: Git Users

From: "Fahad Ashfaque" <fahadash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>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
>

I simply have (from 'git config -l'):
core.editor='C:/Program 
Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noplugin

>
> 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,
Correct. The "Linux" bash is rooted, _usually_, at the base of your 
personal 'c:/documents and settings' (or whatever on your Windows 
version), with the MS drives under /c/ and /d/ etc. i.e. a load of 
virtualisation.

use 'pwd -W' to get the true (Windows) path of your current/present 
working directory. (I had to ask just a few days ago ;-)

> c:/ is root
> of my repository because when I run 'ls c:/' I get files from root of
> my repository.
I wouldn't have expected that to play nice (confusion between windows 
and linux path styles).

>
> 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

I've also copied in the Git user / Git for Human beings list (for 
reference) which can be useful for Windows based issues.

>
> Thanks
>
> Fahad
> --

-- 
You received this message because you are subscribed to the Google Groups "Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

* Re: Cannot set the commit-message editor
  2014-11-21 17:48 ` Philip Oakley
@ 2014-11-21 19:51   ` Fahad Ashfaque
  2014-11-21 21:14     ` Philip Oakley
  0 siblings, 1 reply; 4+ messages in thread
From: Fahad Ashfaque @ 2014-11-21 19:51 UTC (permalink / raw)
  To: Philip Oakley; +Cc: git, Git Users

still don't get it.

I run /c/path/to/npp.sh just fine,.... Its only 'git commit' that is
teleporting me to a different world. So there is NO way I can refer to
folders outside of my repository in a shell script when it is used in
a config param ?

I will try setting the core.editor to the value you suggested.

On Fri, Nov 21, 2014 at 12:48 PM, Philip Oakley <philipoakley@iee.org> wrote:
> From: "Fahad Ashfaque" <fahadash@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
>>
>
> I simply have (from 'git config -l'):
> core.editor='C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar
> -nosession -noplugin
>
>>
>> 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,
>
> Correct. The "Linux" bash is rooted, _usually_, at the base of your personal
> 'c:/documents and settings' (or whatever on your Windows version), with the
> MS drives under /c/ and /d/ etc. i.e. a load of virtualisation.
>
> use 'pwd -W' to get the true (Windows) path of your current/present working
> directory. (I had to ask just a few days ago ;-)
>
>> c:/ is root
>> of my repository because when I run 'ls c:/' I get files from root of
>> my repository.
>
> I wouldn't have expected that to play nice (confusion between windows and
> linux path styles).
>
>>
>> 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
>
>
> I've also copied in the Git user / Git for Human beings list (for reference)
> which can be useful for Windows based issues.
>
>>
>> Thanks
>>
>> Fahad
>> --
>
>

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

* Re: Cannot set the commit-message editor
  2014-11-21 19:51   ` Fahad Ashfaque
@ 2014-11-21 21:14     ` Philip Oakley
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Oakley @ 2014-11-21 21:14 UTC (permalink / raw)
  To: Fahad Ashfaque; +Cc: git-u79uwXL29TY76Z2rM5mHXA, Git Users

From: "Fahad Ashfaque" <fahadash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> still don't get it.
>

Do check each instance of bash separately. Each can have a different 
virtual root.

I was caught by this just last week on Msysgit (the msys.bat) where that 
has a different base address to the Git bash version in "C:\program 
files".
https://groups.google.com/d/msg/msysgit/prLaAOCF9Ig/l1zRsYfVrqwJ

> I run /c/path/to/npp.sh just fine,.... Its only 'git commit' that is
> teleporting me to a different world. So there is NO way I can refer to
> folders outside of my repository in a shell script when it is used in
> a config param ?
>
> I will try setting the core.editor to the value you suggested.
>
> On Fri, Nov 21, 2014 at 12:48 PM, Philip Oakley <philipoakley-7KbaBNvhQFM@public.gmane.org> 
> wrote:
>> From: "Fahad Ashfaque" <fahadash-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>>>
>>> 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
>>>
>>
>> I simply have (from 'git config -l'):
>> core.editor='C:/Program 
>> Files/Notepad++/notepad++.exe' -multiInst -notabbar
>> -nosession -noplugin
>>
>>>
>>> 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,
>>
>> Correct. The "Linux" bash is rooted, _usually_, at the base of your 
>> personal
>> 'c:/documents and settings' (or whatever on your Windows version), 
>> with the
>> MS drives under /c/ and /d/ etc. i.e. a load of virtualisation.
>>
>> use 'pwd -W' to get the true (Windows) path of your current/present 
>> working
>> directory. (I had to ask just a few days ago ;-)
>>
>>> c:/ is root
>>> of my repository because when I run 'ls c:/' I get files from root 
>>> of
>>> my repository.
>>
>> I wouldn't have expected that to play nice (confusion between windows 
>> and
>> linux path styles).
>>
>>>
>>> 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
>>
>>
>> I've also copied in the Git user / Git for Human beings list (for 
>> reference)
>> which can be useful for Windows based issues.
>>
>>>
>>> Thanks
>>>
>>> Fahad
>>> --
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
You received this message because you are subscribed to the Google Groups "Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

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

end of thread, other threads:[~2014-11-21 21:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-21 15:57 Cannot set the commit-message editor Fahad Ashfaque
2014-11-21 17:48 ` Philip Oakley
2014-11-21 19:51   ` Fahad Ashfaque
2014-11-21 21:14     ` Philip Oakley

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 NNTP newsgroup(s).