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

[PATCH] Teach core.autocrlf to 'git blame'

From
Marius Storm-Olsen <marius@trolltech.com>
Date
Oct 5, 2007, 12:13 UTC
Message-ID
<1191586411-7436-1-git-send-email-marius@trolltech.com>

Pass the fake commit through convert_to_git, so that the file is adjusted for local line-ending convention.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
---
 Added missing signoff in the previous mail.
 builtin-blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index e3112a2..8432b82 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2059,6 +2059,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
 		if (strbuf_read(&buf, 0, 0) < 0)
 			die("read error %s from stdin", strerror(errno));
 	}
+	convert_to_git(path, buf.buf, buf.len, &buf);
 	origin->file.ptr = buf.buf;
 	origin->file.size = buf.len;
 	pretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_sha1);
-- 
1.5.3.4.1155.gfe96ee-dirty
Next: Marius Storm-Olsen
Message 1 of 2 in “Teach core.autocrlf to 'git blame'”
  1. Teach core.autocrlf to 'git blame'Marius Storm-Olsen, Oct 5, 2007
  2. Marius Storm-OlsenOct 17, 2007

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.