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

Re: git blame shows wrong "Not commited yet" entries

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2012, 21:32 UTC
Message-ID
<7v7gsgqd4w.fsf@alter.siamese.dyndns.org>
In-Reply-To
<303882026.440710.1346315214352.JavaMail.ngmail@webmail08.arcor-online.net>
Thomas Ackermann <th.acker66@arcor.de> writes:
Show 6 quoted lines
> I am using MsysGit 1.7.11 on WinXP 32 bit and experience the folllowing strange behaviour:
>  
> For a file like "File.txt" in the repo, "git blame file.txt" (note the lower case)
> shows "Not commited yet" for every single line in the file. 
> "git blame File.txt" (correct upper case spelling) gives the correct output.
> "core.ignorecase" is "true" so this behaviour is not what I expected.
What happens when you do this?
	$ echo garbage >no-such-file-tracked.txt
        $ git blame no-such-file-tracked.txt

If you see everything attributed to the working tree file, I _think_ you are seeing exactly the same thing. As far as your repository history is concerned, "file.txt" is never tracked ("File.txt" is), and when Git asks the contents for "file.txt" in the working tree, Windows case insensitive filesystem gives it the contents of "File.txt" instead, all lines in which is initially attributed to the working tree. When blame tries to pass the blame around to the commit at HEAD and down the history, it never finds "file.txt", so all the blame is given to this phamtom contents from "File.txt" Windows gave you as if it were stored in "file.txt", which does not really exist.

An obvious workaround is to say "git blame File.txt". You might be able to patch MsysGit so that "git blame file.txt" errors out when it does not find such a path in the HEAD commit, though.

Previous: Thomas AckermannNext: Thomas Ackermann
Message 2 of 5 in “git blame shows wrong "Not commited yet" entries”
  1. Thomas AckermannAug 30, 2012
  2. Junio C HamanoAug 30, 2012
  3. Aw: Re: git blame shows wrong "Not commited yet" entriesThomas Ackermann, Aug 31, 2012
  4. Junio C HamanoAug 31, 2012
  5. Martin von ZweigbergkSep 2, 2012

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.