threads / discuss / 24423

Challenge with Git-Bash

Subject: Challenge with Git-Bash

## tl;dr

9 messages between Jul 17, 2010 and Jul 19, 2010.

replies: 8people: 4as markdown or json

Rainer Lauer· Jul 17, 2010, 16:20 UTC · lore
Hello,
with my Windows 7 Git-Installation I get following challenge:
1)	Set GIT_EDITOR to editor of your choice
2)	With Windows7 let this editor run in admin-mode
	Goto .exe-file -> right mouse-click -> compatibility -> run program
as admin (I'm running a German version maybe English names are slightly
different)
3)	Make a git action like git add file
                             git commit
	from the git bash.
4)	Now following message appears:  sh.exe: ./"editor of your choice":
Bad file number
Everything is fine without Admin-Mode set for editor. In other words if you
get rid of step 2) step 4) doesn't appear instead the editor starts.
Due to other tasks my editor of choice has to run in this mode - stupid
enough.

Any chance to get around this problem? (No not taking a different editor, no not getting rid of admin mode :) )

Reggies, Rainer Lauer

Ævar Arnfjörð Bjarmason· Jul 17, 2010, 16:36 UTC · re: Rainer Lauer · lore

Re: Challenge with Git-Bash

On Sat, Jul 17, 2010 at 16:20, Rainer Lauer <lauerr@gmx.net> wrote:
Show 19 quoted lines
> Hello,
> with my Windows 7 Git-Installation I get following challenge:
> 1)      Set GIT_EDITOR to editor of your choice
> 2)      With Windows7 let this editor run in admin-mode
>        Goto .exe-file -> right mouse-click -> compatibility -> run program
> as admin (I'm running a German version maybe English names are slightly
> different)
> 3)      Make a git action like git add file
>                             git commit
>        from the git bash.
> 4)      Now following message appears:  sh.exe: ./"editor of your choice":
> Bad file number
> Everything is fine without Admin-Mode set for editor. In other words if you
> get rid of step 2) step 4) doesn't appear instead the editor starts.
> Due to other tasks my editor of choice has to run in this mode - stupid
> enough.
>
> Any chance to get around this problem?
> (No not taking a different editor, no not getting rid of admin mode :) )

Did you actually set "GIT_EDITOR" to the string "editor of your choice", as opposed to the full path to Emacs, notepad or something like that?

Jonathan Nieder· Jul 17, 2010, 17:13 UTC · re: Rainer Lauer · lore

Re: Challenge with Git-Bash

(+cc: msysgit)
Hi Rainer,
Rainer Lauer wrote:
Show 17 quoted lines
> with my Windows 7 Git-Installation I get following challenge:
>
> 1)	Set GIT_EDITOR to editor of your choice
>
> 2)	With Windows7 let this editor run in admin-mode
> 	Goto .exe-file -> right mouse-click -> compatibility -> run program
>	as admin (I'm running a German version maybe English names are slightly
>	different)
>
> 3)	Make a git action like git add file
>	                       git commit
> 	from the git bash.
>
> 4)	Now following message appears:  sh.exe: ./"editor of your choice":
> Bad file number
>
> Everything is fine without Admin-Mode set for editor.

Apparently “Bad file number” can mean “Permission denied” among other things on Windows. I do not have any better suggestion than to try running git bash as administrator too, sorry.

Regards, Jonathan

Rainer Lauer· Jul 18, 2010, 18:08 UTC · re: Jonathan Nieder · lore

AW: Challenge with Git-Bash

Hi Jonathan, thanks for this hint. Now it is working on the base of environment variables.

In order of automatically setting up my projects I'd like to use the configuration file for preparing CVS-work instead introducing environment variables. Unfortunately, I'm facing another problem. Following commands don't modify .git/config coming along with my project(s). git config user.name="Rainer Lauer" git config user.email="Rainer.Lauer@gmx.net" git config core.editor="c:/Program Files/SlickEditV14.0.2/win/vs.exe" The file seems to stay in initial revision as created with the command git init.

Where is following information stored? Command:  git config --global user.name="Rainer Lauer". Did I get the documentation right that this is a definition for all projects?

Regards, Rainer

-----Ursprüngliche Nachricht-----
Von: Jonathan Nieder [mailto:jrnieder@gmail.com] 
Gesendet: Samstag, 17. Juli 2010 19:13
An: Rainer Lauer
Cc: git@vger.kernel.org; msysgit@googlegroups.com
Betreff: Re: Challenge with Git-Bash
(+cc: msysgit)
Hi Rainer,
Rainer Lauer wrote:
Show 17 quoted lines
> with my Windows 7 Git-Installation I get following challenge:
>
> 1)	Set GIT_EDITOR to editor of your choice
>
> 2)	With Windows7 let this editor run in admin-mode
> 	Goto .exe-file -> right mouse-click -> compatibility -> run program
>	as admin (I'm running a German version maybe English names are slightly
>	different)
>
> 3)	Make a git action like git add file
>	                       git commit
> 	from the git bash.
>
> 4)	Now following message appears:  sh.exe: ./"editor of your choice":
> Bad file number
>
> Everything is fine without Admin-Mode set for editor.
Apparently “Bad file number” can mean “Permission denied” among other things on Windows.  I do not have any better suggestion than to try running git bash as administrator too, sorry.

Regards, Jonathan

Ævar Arnfjörð Bjarmason· Jul 18, 2010, 18:11 UTC · re: Rainer Lauer · lore

Re: Challenge with Git-Bash

On Sun, Jul 18, 2010 at 18:08, Rainer Lauer <lauerr@gmx.net> wrote:
Show 12 quoted lines
> Hi Jonathan,
> thanks for this hint. Now it is working on the base of environment variables.
>
> In order of automatically setting up my projects I'd like to use the configuration file for preparing  CVS-work instead introducing environment variables.
> Unfortunately, I'm facing another problem.
> Following commands don't modify .git/config coming along with my project(s).
> git config user.name="Rainer Lauer"
> git config user.email="Rainer.Lauer@gmx.net"
> git config core.editor="c:/Program Files/SlickEditV14.0.2/win/vs.exe"
> The file seems to stay in initial revision as created with the command git init.
>
> Where is following information stored? Command:  git config --global user.name="Rainer Lauer". Did I get the documentation right that this is a definition for all projects?

If you're asking why your .git/config file isn't being carried over when you clone the repository that's because it's not supposed to, Git doesn't work like that.

Jonathan Nieder· Jul 18, 2010, 18:16 UTC · re: Rainer Lauer · lore

Files used by git config (Re: Challenge with Git-Bash)

Hi again,
Rainer Lauer wrote:
> Where is following information stored?
> Command:  git config --global user.name="Rainer Lauer".

I recommend looking that the user manual[1] to start out. It has a few relevant hints.

From the preface:
	Comprehensive reference documentation is available
	through the man pages, or git-help(1) command. For
	example, for the command "git clone <repo>", you can
	either use:
	$ man git-clone
	or:
	$ git help clone
From the start to “chapter 3: developing with git”:
	Before creating any commits, you should introduce
	yourself to git. The easiest way to do so is to make sure
	the following lines appear in a file named .gitconfig in
	your home directory:
	[user]
		name = Your Name Comes Here
		email = you@yourdomain.example.com
	(See the "CONFIGURATION FILE" section of git-config(1)
	for details on the configuration file.)

Regards, Jonathan

[1] http://kernel.org/pub/software/scm/git/docs/user-manual.html
Eric Raible· Jul 19, 2010, 18:09 UTC · re: Rainer Lauer · lore

Re: AW: Challenge with Git-Bash

Rainer Lauer <lauerr <at> gmx.net> writes:
> Where is following information stored? Command:  git config --global 
user.name="Rainer Lauer".

The '=' appears in your config file (.git/config), but shouldn't be used on the comand line.

Ævar Arnfjörð Bjarmason· Jul 18, 2010, 14:55 UTC · lore

Re: Challenge with Git-Bash

On Sun, Jul 18, 2010 at 14:42, Rainer Lauer <lauerr@gmx.net> wrote:
> Hi,
> thanks for the reply. I did set the full path to my editor of choice.

Good that it worked out. CC-ing the list so that others encountering this problem will find the solution.

Rainer Lauer· Jul 18, 2010, 17:02 UTC · re: Ævar Arnfjörð Bjarmason · lore

AW: Challenge with Git-Bash

Hi, from Jonathan Nieder <jrnieder@gmail.com> I got a successfully work-around. See attached mail. Thanks for your support and amazingly fast response.

Regis, Rainer Lauer

-----Ursprüngliche Nachricht-----
Von: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] 
Gesendet: Sonntag, 18. Juli 2010 16:56
An: Rainer Lauer
Cc: Git Mailing List
Betreff: Re: Challenge with Git-Bash
On Sun, Jul 18, 2010 at 14:42, Rainer Lauer <lauerr@gmx.net> wrote:
> Hi,
> thanks for the reply. I did set the full path to my editor of choice.
Good that it worked out. CC-ing the list so that others encountering this problem will find the solution.
(+cc: msysgit)
Hi Rainer,
Rainer Lauer wrote:
Show 17 quoted lines
> with my Windows 7 Git-Installation I get following challenge:
>
> 1)	Set GIT_EDITOR to editor of your choice
>
> 2)	With Windows7 let this editor run in admin-mode
> 	Goto .exe-file -> right mouse-click -> compatibility -> run program
>	as admin (I'm running a German version maybe English names are slightly
>	different)
>
> 3)	Make a git action like git add file
>	                       git commit
> 	from the git bash.
>
> 4)	Now following message appears:  sh.exe: ./"editor of your choice":
> Bad file number
>
> Everything is fine without Admin-Mode set for editor.

Apparently “Bad file number” can mean “Permission denied” among other things on Windows. I do not have any better suggestion than to try running git bash as administrator too, sorry.

Regards, Jonathan

← back to recent threads