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

Re: git-blame not tracking copies

From
Junio C Hamano <junkio@cox.net>
Date
May 2, 2007, 23:42 UTC
Message-ID
<7v8xc64wsu.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200705022033.25885.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
> All git-blame commands are "git-blame -C1 -C1"

I am sick and not functioning well today, so will not be able to review what is happening with your example deeply, but here are some comments to get you started digging.

There is a built-in sanity valve in git-blame that refuses to pass down the blame via -M/-C for really trivial hunks. Without such safety, all the empty lines in the latest revision would be attributed to a random empty line in a random file in the root commit ;-).

By default, the sanity valve is set to refuse a hunk that has 20 or 40 alnum characters. These values seem to be appropriate for real life projects, but obviously the real-world case would be very different from a made-up "each commit changes one-line" test case and it would be understandable that the command would behave differently.

Also with real-life projects, probably depending on the coding style and merge patterns, I would not be surprised if there are rooms to tweak the heuristics.

Previous: Andy ParkinsNext: Andy Parkins
Message 2 of 4 in “git-blame not tracking copies”
  1. Andy ParkinsMay 2, 2007
  2. Junio C HamanoMay 2, 2007
  3. Andy ParkinsMay 3, 2007
  4. Junio C HamanoMay 6, 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.