Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get notepad.exe to work as editor #381

Closed
dscho opened this issue Sep 11, 2015 · 15 comments
Closed

Get notepad.exe to work as editor #381

dscho opened this issue Sep 11, 2015 · 15 comments

Comments

@dscho
Copy link
Member

dscho commented Sep 11, 2015

Yep, it is ugly, but it is more intuitive than vim...

@linquize
Copy link

But notepad.exe does not know LF as line ending, which is more stupid

@dscho
Copy link
Member Author

dscho commented Sep 12, 2015

I would call it unfortunate, but yes, this is one thing I need to address (and talking about it won't fix it...).

@Dirk1966
Copy link

I know a lot of Windows users and I always recommended them of installing Notepad++, where you can find a lot of hints how to do it (see at bottom).
If you want to implement this, then git.exe should analyze the text and replace CRLF by LF?!? Or do you plan to provide a wrapper script which does this by configuration?

32 bit NotePad++
git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

64 bit NotePad++
git config --global core.editor "'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

@PhilipOakley
Copy link

Just to confirm that those four Notepad++ options "-multiInst -notabbar -nosession -noPlugin" have worked well for me. And they appear to the lead advice on StackOverflow.

I even have the same quoting inside my .gitconfig ;-)

but that's not plain vanilla notepad.exe though...

@Dirk1966
Copy link

Hi all, I created a perl wrapper for notepad, which replaces the stuff and checks for errors.
I did not put it in the git-queue, this I will try today. Had problems with the perl output with LF instead of CRLF only although I used binmode and used a "hackaround" with dos2unix.

@Dirk1966
Copy link

My perl shell script seems to work now also under Windows 10.
I did not identify why I had problems there last night. I tested it
under the current "git for Windows 2" under "Windows 10" and
"Windows 8.1". Shall I put the perl script somewhere?

@Dirk1966
Copy link

An extensive log shows that I might have a perl problem on "Windows 10", but I was able to check in there.

@dscho
Copy link
Member Author

dscho commented Sep 14, 2015

Shall I put the perl script somewhere?

If you want anybody else to benefit from it, I would highly recommend that. Maybe as a Pull Request? It could live in git-extra, just like e.g. vi...

An extensive log shows that I might have a perl problem on "Windows 10",

I had problems on Windows 10, too, recently, but only in 32-bit mode. It would display the famous 32-bit problems and it would need some trickery.

You did not let us know, however, what the nature of your emergency was, nor much of any context. In any case, different problems are better discussed in different tickets.

@Dirk1966
Copy link

I created my first real repo and put the solution including some docu and two additional test files there:
https://github.com/Dirk1966/NotPad.git
I tested it now successfully under 64bit Windows 7, 8.1 and could use notepad.exe under Windows 10, 32 bit, but it seems that CRLF is not replaced by LF after editing the file with notepad.exe.

Unfortunately, I could not push to git-extra. Will try this evening again.

$ git push --set-upstream origin perl-wrapper-notepad.exe-as-commit-editor
Username for 'https://github.com': Dirk1966
Password for 'https://[email protected]':
remote: Permission to git-for-windows/build-extra.git denied to Dirk1966.
fatal: unable to access 'https://github.com/git-for-windows/build-extra.git/': The requested URL returned error: 403

@Dirk1966
Copy link

Got the stuff in with the web interface.
If you call the script without a file name, there is a small description/explanation.
Create NotPad.sh
[https://github.com/git-for-windows/build-extra/pull/76]

@dscho
Copy link
Member Author

dscho commented Sep 14, 2015

Got the stuff in with the web interface.

Probably you forked only during that edit; you can now push into the forked repository, now that you have it.

@dscho
Copy link
Member Author

dscho commented Sep 14, 2015

And here is my shell script version of that wrapper: git-for-windows@ master...dscho:notepad

@dscho
Copy link
Member Author

dscho commented Sep 14, 2015

Fixed via git-for-windows/build-extra@69b301b

@dscho dscho closed this as completed Sep 14, 2015
@ghost
Copy link

ghost commented Sep 27, 2015

How can i install the Command "wget" in Git?

@dscho
Copy link
Member Author

dscho commented Sep 28, 2015

@Simon-Krull please follow proper procedure. Your question has nothing to do with this ticket, so you need to start a new conversation. Since you are not even referring to a bug or enhancement in Git for Windows, you should use the mailing list. You can easily find the information on the top right of our home page -- and also some guide lines how to contribute properly in its Contribute section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants