question about COMMIT_EDITMSG crlf

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

question about COMMIT_EDITMSG crlf

From: Frank Li <hidden>
Date: 2016-06-15 22:45:56

I want to use notepad replace default vim at commit message editor.
git commit will create COMMIT_EDITMSG at .git directory. This file is
unix text mode.
Is there any config change it to windows text mode?

Re: question about COMMIT_EDITMSG crlf

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:45:56

Frank Li schrieb:
I want to use notepad replace default vim at commit message editor.
git commit will create COMMIT_EDITMSG at .git directory. This file is
unix text mode.
Is there any config change it to windows text mode?
No, there isn't. But perhaps you can use WordPad instead of Notepad? There
are reports that this worked.

You could also write a wrapper script that transforms the file before it
calls Notepad on it (untested):

   #!/bin/bash
   sed -e $'s/\r?$/\r/' < "$1" > .git/tmp$$ &&
   mv .git/tmp$$ "$1" &&
   notepad "$1"

I think git commit removes the trailing CRs automatically, so they don't
end up in the commit message.

-- Hannes

Re: question about COMMIT_EDITMSG crlf

From: Juanma Barranquero <hidden>
Date: 2016-06-15 22:45:56

On Wed, Jan 14, 2009 at 08:18, Johannes Sixt [off-list ref] wrote:
No, there isn't. But perhaps you can use WordPad instead of Notepad? There
are reports that this worked.
Or Notepad2:

http://www.flos-freeware.ch/notepad2.html

    Juanma
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help