{"thread":{"id":"21763","subject":"What should a user expect from git log -M -- file","startedAt":"2009-11-26T16:36:54Z","lastAt":"2009-11-27T07:28:20Z","messageCount":3,"participants":["Mike Hommey","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"128476","messageId":"20091126163654.GA14509@glandium.org","threadId":"21763","inReplyTo":null,"subject":"What should a user expect from git log -M -- file","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2009-11-26T16:36:54Z","receivedAt":"2009-11-26T16:36:54Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"Hi,\n\nI recently reorganized a project of mine, and the result is that a lot of\nfiles moved from the top directory to a sub directory.\n\nNow, I innocently tried to 'git log -M' some of these files in the\nsubdirectories, and well, the history just stops when the file was\ncreated. Obviously, if I put both the old and the new location it works,\nbut shouldn't users expect 'git log -M -- file' to try to find the\nprevious path and continue from there ?\n\nMike\n"},{"id":"128480","messageId":"m3ocmpmcoq.fsf@localhost.localdomain","threadId":"21763","inReplyTo":"20091126163654.GA14509@glandium.org","subject":"Re: What should a user expect from git log -M -- file","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-11-26T17:14:37Z","receivedAt":"2009-11-26T17:14:37Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> I recently reorganized a project of mine, and the result is that a lot of\n> files moved from the top directory to a sub directory.\n> \n> Now, I innocently tried to 'git log -M' some of these files in the\n> subdirectories, and well, the history just stops when the file was\n> created. Obviously, if I put both the old and the new location it works,\n> but shouldn't users expect 'git log -M -- file' to try to find the\n> previous path and continue from there ?\n\nWhat you want is not\n\n  git log -M -- file\n\nbut\n\n  git log --follow file\n\n\"git log -M -- file\" IIRC first applies path limiting, simplifying\nhistory, *then* does rename detection, and finally filters output\n(unless --full-diff is used).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"128537","messageId":"20091127072820.GA17045@glandium.org","threadId":"21763","inReplyTo":"m3ocmpmcoq.fsf@localhost.localdomain","subject":"Re: What should a user expect from git log -M -- file","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2009-11-27T07:28:20Z","receivedAt":"2009-11-27T07:28:20Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Thu, Nov 26, 2009 at 09:14:37AM -0800, Jakub Narebski wrote:\n> Mike Hommey <mh@glandium.org> writes:\n> \n> > I recently reorganized a project of mine, and the result is that a lot of\n> > files moved from the top directory to a sub directory.\n> > \n> > Now, I innocently tried to 'git log -M' some of these files in the\n> > subdirectories, and well, the history just stops when the file was\n> > created. Obviously, if I put both the old and the new location it works,\n> > but shouldn't users expect 'git log -M -- file' to try to find the\n> > previous path and continue from there ?\n> \n> What you want is not\n> \n>   git log -M -- file\n> \n> but\n> \n>   git log --follow file\n> \n> \"git log -M -- file\" IIRC first applies path limiting, simplifying\n> history, *then* does rename detection, and finally filters output\n> (unless --full-diff is used).\n\nThat's what I was looking for, thanks. I would suggest to put --follow\ncloser to -M and -C in the documentation, but the way the git-log\nmanual is generated (including diff options) makes that impossible :(\n\nMike\n"}]}