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

Re: git blame: "Not Committed Yet" with clean WD

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 14, 2014, 19:10 UTC
Message-ID
<20140214191015.GG4582@vauxhall.crustytoothpaste.net>
In-Reply-To
<52FC8BA7.30102@gmail.com>
On Thu, Feb 13, 2014 at 10:08:55AM +0100, Ephrim Khong wrote:
Show 34 quoted lines
> Hi,
> 
> for files that contain windows line endings in a repository with
> core.autocrlf=input, git blame will show lines as "Not Committed
> Yet", even though they were not modified.
> 
> Example:
> 
> --
> git init
> git config core.autocrlf false
> echo "foo" > a
> unix2dos a
> git add a
> git commit -m "initial commit"
> git config core.autocrlf input
> git status
> git blame a
> --
> 
> Output:
> 
> --
> Reinitialized existing Git repository in /.../testblame2/.git/
> unix2dos: converting file a to DOS format ...
> On branch master
> nothing to commit, working directory clean
> On branch master
> nothing to commit, working directory clean
> 00000000 (Not Committed Yet 2014-02-13 10:02:43 +0100 1) foo
> --
> 
> Is there an easy way to work around this; is this desired behaviour
> or mor a bug?

I'm pretty sure this is a bug. git blame should show the proper information in this case.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Ephrim KhongNext: brian m. carlson
Message 2 of 4 in “git blame: "Not Committed Yet" with clean WD”
  1. Ephrim KhongFeb 13, 2014
  2. brian m. carlsonFeb 14, 2014
  3. blame: add a failing test for a CRLF issue.brian m. carlson, Feb 18, 2014
  4. Torsten BögershausenFeb 19, 2014

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.