{"thread":{"id":"20536","subject":"rename/copy detection not working for git-log?","startedAt":"2009-08-11T13:21:44Z","lastAt":"2009-08-11T13:57:36Z","messageCount":3,"participants":["Kevin Green","Bruce Stephens"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"120264","messageId":"20090811132144.GJ6327@morganstanley.com","threadId":"20536","inReplyTo":null,"subject":"rename/copy detection not working for git-log?","fromName":"Kevin Green","fromEmail":"kevin.t.green@morganstanley.com","sentAt":"2009-08-11T13:21:44Z","receivedAt":"2009-08-11T13:21:44Z","isPatch":false,"sender":{"key":"kevin.t.green@morganstanley.com","avatar":null},"body":"\nHi,\n\nI'm pretty sure I've seen this working as expected at some point in the\npast, but I'm now not able to get the full history of a file that's\nbeen moved to another directory and I can't understand why.  Here's a\nsimple way to reproduce:\n\n  $ git init\n  Initialized empty Git repository in /var/tmp/git/.git/\n  $ mkdir bin\n  $ cat > bin/test.sh\n  #!/bin/sh\n\n  echo Hello, world!\n  $ git add .\n  $ git commit -m 'initial import'\n  [master (root-commit) b9dc5be] initial import\n   1 files changed, 3 insertions(+), 0 deletions(-)\n    create mode 100644 bin/test.sh\n  $ mkdir scripts\n  $ git mv bin/test.sh scripts/test.sh\n  $ git commit -m 'move bin/ to scripts/'\n  [master b4c6c72] move bin/ to scripts/\n   1 files changed, 0 insertions(+), 0 deletions(-)\n    rename {bin => scripts}/test.sh (100%)\n  $ echo 'echo Goodbye!' >> scripts/test.sh\n  $ git commit -a -m 'make a change in scripts/'\n  [master 59830d5] make a change in scripts/\n   1 files changed, 1 insertions(+), 0 deletions(-)\n\n\nThis now has full history of:\n\n  $ git log --pretty=oneline\n  59830d59f6b4d48b28f2ae8d51e921a9c8842b06 make a change in scripts/\n  b4c6c72c548a1c17550c01350beede235d481aa4 move bin/ to scripts/\n  b9dc5be440d2c843554e9b0302435d9a6f78cd65 initial import \n\nand the history of scripts/test.sh is as I expect:\n\n  $ git log --pretty=oneline -- scripts/test.sh\n  59830d59f6b4d48b28f2ae8d51e921a9c8842b06 make a change in scripts/\n  b4c6c72c548a1c17550c01350beede235d481aa4 move bin/ to scripts/\n\nand the history of bin/test.sh is as I would expect:\n\n  $ git log --pretty=oneline -- bin/test.sh\n  b4c6c72c548a1c17550c01350beede235d481aa4 move bin/ to scripts/\n  b9dc5be440d2c843554e9b0302435d9a6f78cd65 initial import\n\n\nBut, I would expect that some combination of -M and -C would find me\nthe full history of the current test.sh script so I could see what\nhappened to it before it was moved.  (Okay, the example above is not so\ninteresting, but in the real world, bin/test.sh would have had lots of\ncommits before moving):\n\n  $ git log --pretty=oneline -M -C -C -- scripts/test.sh\n  59830d59f6b4d48b28f2ae8d51e921a9c8842b06 make a change in scripts/\n  b4c6c72c548a1c17550c01350beede235d481aa4 move bin/ to scripts/\n\ngit-blame seems to get this right:\n\n  $ git blame scripts/test.sh\n  ^b9dc5be bin/test.sh     (Kevin Green 2009-08-11 09:07:06 -0400 1) #!/bin/sh\n  ^b9dc5be bin/test.sh     (Kevin Green 2009-08-11 09:07:06 -0400 2)\n  ^b9dc5be bin/test.sh     (Kevin Green 2009-08-11 09:07:06 -0400 3) echo Hello, world!\n  59830d59 scripts/test.sh (Kevin Green 2009-08-11 09:08:29 -0400 4) echo Goodbye!\n\n\nWhat am I missing?\n\n\nThanks\n\n--Kevin\n"},{"id":"120265","messageId":"807hxasbz4.fsf@tiny.isode.net","threadId":"20536","inReplyTo":"20090811132144.GJ6327@morganstanley.com","subject":"Re: rename/copy detection not working for git-log?","fromName":"Bruce Stephens","fromEmail":"bruce.stephens@isode.com","sentAt":"2009-08-11T13:42:55Z","receivedAt":"2009-08-11T13:42:55Z","isPatch":false,"sender":{"key":"bruce.stephens@isode.com","avatar":null},"body":"Kevin Green <Kevin.T.Green@morganstanley.com> writes:\n\n[...]\n\n> What am I missing?\n\nI'd guess --follow\n"},{"id":"120268","messageId":"20090811135736.GL6327@morganstanley.com","threadId":"20536","inReplyTo":"807hxasbz4.fsf@tiny.isode.net","subject":"Re: rename/copy detection not working for git-log?","fromName":"Kevin Green","fromEmail":"kevin.t.green@morganstanley.com","sentAt":"2009-08-11T13:57:36Z","receivedAt":"2009-08-11T13:57:36Z","isPatch":false,"sender":{"key":"kevin.t.green@morganstanley.com","avatar":null},"body":"On 08/11/09 09:42:55, Bruce Stephens wrote:\n> Kevin Green <Kevin.T.Green@morganstanley.com> writes:\n> \n> [...]\n> \n> > What am I missing?\n> \n> I'd guess --follow\n\nAh, yep...  didn't see that earlier.  Exactly what I need, thanks.\n\n\n--Kevin\n"}]}