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

Should copy/rename detection consider file overwrites?

From
Mike Hommey <mh@glandium.org>
Date
Jan 23, 2015, 01:29 UTC
Message-ID
<20150123012908.GA8558@glandium.org>
Hi,

While fooling around with copy/rename detection, I noticed that it doesn't detect the case where you copy or rename a file on top of another:

$ git init $ (echo foo; echo bar) > foo $ git add foo $ git commit -m foo $ echo 0 > bar $ git add bar $ git commit -m bar $ git mv -f foo bar $ git commit -m foobar $ git log --oneline --reverse 7dc2765 foo b0c837d bar 88caeba foobar $ git blame -s -C -C bar 88caebab 1) foo 88caebab 2) bar

I can see how this is not trivially representable in e.g. git diff-tree, but shouldn't at least blame try to tell that those lines actually come from 7dc2765?

Mike
Next: Jeff King
Message 1 of 3 in “Should copy/rename detection consider file overwrites?”
  1. Mike HommeyJan 23, 2015
  2. Jeff KingJan 23, 2015
  3. Mike HommeyJan 23, 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.