# question about COMMIT_EDITMSG crlf

4 messages from 2009-01-14 to 2009-01-14. Participants: Frank Li, Junio C Hamano, Johannes Sixt, Juanma Barranquero.
Thread: https://gitlist.dev/t/17164

## Frank Li, 2009-01-14 05:17

Subject: question about COMMIT_EDITMSG crlf
Message-ID: <1976ea660901132117l7947157fw2922465a9b3945dc@mail.gmail.com>
URL: https://gitlist.dev/e/1976ea660901132117l7947157fw2922465a9b3945dc%40mail.gmail.com

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

```

## Junio C Hamano, 2009-01-14 07:04

Subject: Re: question about COMMIT_EDITMSG crlf
Message-ID: <7vr6365px1.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vr6365px1.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1976ea660901132117l7947157fw2922465a9b3945dc@mail.gmail.com>

```
"Frank Li" <lznuaa@gmail.com> writes:

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

Nothing I can think of, other than using customized commit templates,
which I suspect is a bit overkill and at the same time misses the point
for this use case.

```

## Johannes Sixt, 2009-01-14 07:18

Subject: Re: question about COMMIT_EDITMSG crlf
Message-ID: <496D91CE.1000504@viscovery.net>
URL: https://gitlist.dev/e/496D91CE.1000504%40viscovery.net
In-Reply-To: <1976ea660901132117l7947157fw2922465a9b3945dc@mail.gmail.com>

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

```

## Juanma Barranquero, 2009-01-14 09:01

Subject: Re: question about COMMIT_EDITMSG crlf
Message-ID: <f7ccd24b0901140101k1e0ca6aan1dbba537461a271a@mail.gmail.com>
URL: https://gitlist.dev/e/f7ccd24b0901140101k1e0ca6aan1dbba537461a271a%40mail.gmail.com
In-Reply-To: <496D91CE.1000504@viscovery.net>

```
On Wed, Jan 14, 2009 at 08:18, Johannes Sixt <j.sixt@viscovery.net> 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

```
