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

move detection doesnt take filename into account

From
EWElliot Wolk <elliot.wolk@gmail.com>
Date
Jun 30, 2014, 06:38 UTC
Message-ID
<53B105DA.30004@gmail.com>

if you move two identical {e.g.: empty} files to two new locations in a single commit, the move detection picks them {seemingly?} arbitrarily. it should use a statistical algorithm to compare the filenames and pick a likely match.

my apologies in advance if this isnt the right venue or is improperly formatted, or if this is extraneous noise, or widely known, etc.

+ cd /tmp
+ mkdir repo
+ cd repo
+ git init
Initialized empty Git repository in /tmp/repo/.git/
+ touch a1 b1 c1
+ git add a1 b1 c1
+ git commit -m 1
[master (root-commit) 72f8c89] 1
  3 files changed, 0 insertions(+), 0 deletions(-)
  create mode 100644 a1
  create mode 100644 b1
  create mode 100644 c1
+ git mv a1 a2
+ git mv b1 b2
+ git mv c1 c2
+ git commit -m 2
[master 359da78] 2
  3 files changed, 0 insertions(+), 0 deletions(-)
  rename c1 => a2 (100%)
  rename b1 => b2 (100%)
  rename a1 => c2 (100%)
+ git log --name-status -M
commit 359da78caaaf06848ae32359abfeb87db35cdb30
Author: Elliot Wolk <elliot.wolk@gmail.com>
Date:   Mon Jun 30 02:26:49 2014 -0400
     2

R100 c1 a2 R100 b1 b2 R100 a1 c2

commit 72f8c89b418e3b1d13ec350f4c30b5088fc69e83
Author: Elliot Wolk <elliot.wolk@gmail.com>
Date:   Mon Jun 30 02:26:49 2014 -0400
     1

A a1 A b1 A c1

Next: Robin Rosenberg
Message 1 of 11 in “move detection doesnt take filename into account”
  1. Elliot WolkJun 30, 2014
  2. Robin RosenbergJul 1, 2014
  3. Elliot WolkJul 1, 2014
  4. Junio C HamanoJul 1, 2014
  5. Elliot WolkJul 1, 2014
  6. Junio C HamanoJul 1, 2014
  7. Jeff KingJul 9, 2014
  8. Junio C HamanoJul 9, 2014
  9. Jeff KingJul 9, 2014
  10. Junio C HamanoJul 9, 2014
  11. Jeff KingJul 10, 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.