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

git blame breaking on repository with CRLF files

From
BFBenkstein, Frank <frank.benkstein@sap.com>
Date
Aug 7, 2015, 16:32 UTC
Message-ID
<B0BFE3BB9B3E8C4A890D53FA460552D3737328B0@DEWDFEMB16B.global.corp.sap>
Hello,

I am working working on Linux and am examining code in a git repository I do not know much about. I am only looking at files, not changing anything. On some files in the repository I get "00000000 (Not Committed Yet" for all lines when running "git blame". I checked with "git status", "git reset", "git clean" that the files are indeed in the repository and unmodified. I noticed that this only happens with git v2.5.0. With git v2.4.0 it looks correct, i.e. the output has proper commit ids, Author names and dates.. With "git bisect" I tracked this down to the following commit:

 commit 4bf256d67a85bed1e175ecc2706322eafe4489ca (HEAD, refs/bisect/bad)
 Author: Torsten Bögershausen <tboegi@web.de>
 Date:   Sun May 3 18:38:01 2015 +0200
     blame: CRLF in the working tree and LF in the repo

Digging further, it seems that most files in the repository are checked in with CRLF line endings. In my working tree these are checked out as LF - which seems to be the exact opposite situation of what the commit is trying to address. When I set "core.autocrlf" to "false" I also get the correct behavior of "git blame" - this is a workaround as long as I do not have to actually modify anything.

Best regards, Frank.

Next: Torsten Bögershausen
Message 1 of 7 in “git blame breaking on repository with CRLF files”
  1. Benkstein, FrankAug 7, 2015
  2. Torsten BögershausenAug 8, 2015
  3. Torsten BögershausenAug 9, 2015
  4. Benkstein, FrankAug 10, 2015
  5. brian m. carlsonAug 10, 2015
  6. Junio C HamanoAug 10, 2015
  7. Torsten BögershausenAug 10, 2015

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.