{"thread":{"id":"27159","subject":"git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)","startedAt":"2011-04-22T00:31:06Z","lastAt":"2011-04-22T05:22:24Z","messageCount":2,"participants":["Mike","B Smith-Mannschott"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166215","messageId":"BANLkTimqk5xP6X7NcGqZ6w05GfYe02iAhA@mail.gmail.com","threadId":"27159","inReplyTo":null,"subject":"git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)","fromName":"Mike","fromEmail":"xandrani@gmail.com","sentAt":"2011-04-22T00:31:06Z","receivedAt":"2011-04-22T00:31:06Z","isPatch":false,"sender":{"key":"xandrani@gmail.com","avatar":null},"body":"Hi\n\nI deleted a file called 'class.NumberOfResultsCache.php' and created a\ncompletely different file called\n'cgi-bin/___php/class.NumberOfResults.php'. I deleted the file using\nrm followed by 'git rm'.\n\nWhen I do a 'git status' I now get told:\n\n   renamed:    cgi-bin/___php/class.NumberOfResultsCache.php ->\ncgi-bin/___php/class.NumberOfResults.php\n\nHowever I want to commit 'class.NumberOfResultsCache.php' as having\nbeen deleted, and I want to commit 'class.NumberOfResults.php' as a\nbrand new file.\n\nHow do I get git to do this? Apologies for a 'noob' question. Only\nbeen using the superb git for a couple of weeks!\n\nThanks :)\n"},{"id":"166218","messageId":"BANLkTimcL2D_FbKnDREQPNLGG2i8wsoLCg@mail.gmail.com","threadId":"27159","inReplyTo":"BANLkTimqk5xP6X7NcGqZ6w05GfYe02iAhA@mail.gmail.com","subject":"Re: git incorrectly infers rename i.e. (delete file1 + creation of new file2) != (file => file2)","fromName":"B Smith-Mannschott","fromEmail":"bsmith.occs@gmail.com","sentAt":"2011-04-22T05:22:24Z","receivedAt":"2011-04-22T05:22:24Z","isPatch":false,"sender":{"key":"bsmith.occs@gmail.com","avatar":"https://gravatar.com/avatar/46449e07c27bb8a30e4d50c08859f7210d47f6e84526b0a3b903641231dfc1bd?d=mp&s=160"},"body":"On Fri, Apr 22, 2011 at 02:31, Mike <xandrani@gmail.com> wrote:\n> Hi\n>\n> I deleted a file called 'class.NumberOfResultsCache.php' and created a\n> completely different file called\n> 'cgi-bin/___php/class.NumberOfResults.php'.\n\n\"completely different\" in what they mean to you, or in their actual content?\nPlease be more specific.\n\n> I deleted the file using\n> rm followed by 'git rm'.\n>\n> When I do a 'git status' I now get told:\n>\n>   renamed:    cgi-bin/___php/class.NumberOfResultsCache.php ->\n> cgi-bin/___php/class.NumberOfResults.php\n>\n> However I want to commit 'class.NumberOfResultsCache.php' as having\n> been deleted, and I want to commit 'class.NumberOfResults.php' as a\n> brand new file.\n\nGit doesn't care about individual files or renames, it tracks whole trees.\nWhat it shows as a rename is just its best guess based on the contents\nof the two files.\n\n> How do I get git to do this? Apologies for a 'noob' question. Only\n> been using the superb git for a couple of weeks!\n\nYou could commit the deletion and the add separately, but before doing\nthat, why is it important to you that git not show this change as a\npotential rename?\n\n// Ben\n\n> Thanks :)\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"}]}