git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bug: "LF will be replaced by CRLF" warning duplicated two (or three) times

From
EREric Raible <raible@gmail.com>
Date
Jun 18, 2009, 09:17 UTC
Message-ID
<loom.20090618T084545-442@post.gmane.org>

A single "LF will be replaced by CRLF" message is expected in certain cases. But two warnings per file are produced with git-diff --patch-with-stat. Posted here rather than to the msysgit list b.c. I'm guessing it's not msysgit-specific.

$ git --version
git version 1.6.3.msysgit.0
$ mkdir auto-crlf-bug
$ cd auto-crlf-bug/
$ git init
Initialized empty Git repository in d:/auto-crlf-bug/.git/
$ git config core.autocrlf
true
$ touch file42
$ git add file42
$ git commit -m initial
[master (root-commit) 6c22784] initial
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 file42
$ echo something > file42
$ git diff
diff --git a/file42 b/file42
index e69de29..deba01f 100644
--- a/file42
+++ b/file42
@@ -0,0 +1 @@
+something
warning: LF will be replaced by CRLF in file42
$ git diff --patch-with-stat
 file42 |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/file42 b/file42
index e69de29..deba01f 100644
--- a/file42
+++ b/file42
@@ -0,0 +1 @@
+something
warning: LF will be replaced by CRLF in file42
warning: LF will be replaced by CRLF in file42
$


It's even possible to trigger three identical warnings:
$ git add -p
warning: LF will be replaced by CRLF in file42
warning: LF will be replaced by CRLF in file42
warning: LF will be replaced by CRLF in file42
diff --git a/file42 b/file42
index e69de29..deba01f 100644
--- a/file42
+++ b/file42
@@ -0,0 +1 @@
+something
Stage this hunk [y,n,q,a,d,/,e,?]? q
$

This is obviously not a show-stopper, but I thought it worth reporting anyway.

- Eric
Message 1 of 1 in “Bug: "LF will be replaced by CRLF" warning duplicated two (or three) times”
  1. Eric RaibleJun 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.