{"thread":{"id":"42787","subject":"git patch format for rename","startedAt":"2016-07-06T16:11:17Z","lastAt":"2016-07-06T17:45:28Z","messageCount":2,"participants":["Nadya.Zabrodina@jetbrains.com","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"290888","messageId":"F58A6A72-4AE5-42FA-843D-66FF809FF1A8@jetbrains.com","threadId":"42787","inReplyTo":null,"subject":"git patch format for rename","fromName":"Nadya.Zabrodina@jetbrains.com","fromEmail":"nadya.zabrodina@jetbrains.com","sentAt":"2016-07-06T16:00:17Z","receivedAt":"2016-07-06T16:11:17Z","isPatch":false,"sender":{"key":"nadya.zabrodina@jetbrains.com","avatar":null},"body":"Hi,\n\ncould you please explain to me why  ‘rename from & rename to’ information is added to git patch? \n\nHere is the patch created by `git format-patch`: \n\n    diff --git a/before.txt b/after.txt\n    similarity index 100%\n    rename from before.txt\n    rename to after.txt\n\nIs there any reason why git can’t recognize and apply rename-change which looks like this:\n\n    diff --git a/before.txt b/after.txt\n    --- a/before.txt\n    +++ b/after.txt\n    \nor even like this:\n    diff --git a/before.txt b/after.txt\n\n\nI’m implementing a program (with an IDE) to create patches compatible with Git and want to have better understanding of the format and possible issues with it.\n\nThanks a lot in advance.\n\n\n"},{"id":"290892","messageId":"CAGZ79kaA1208Z7kMYJR42NRvYnh4T36M6Rz5W3jok0=ZfvmyHg@mail.gmail.com","threadId":"42787","inReplyTo":"F58A6A72-4AE5-42FA-843D-66FF809FF1A8@jetbrains.com","subject":"Re: git patch format for rename","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-07-06T17:45:22Z","receivedAt":"2016-07-06T17:45:28Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Wed, Jul 6, 2016 at 9:00 AM, Nadya.Zabrodina@jetbrains.com\n<Nadya.Zabrodina@jetbrains.com> wrote:\n> Hi,\n>\n> could you please explain to me why  ‘rename from & rename to’ information is added to git patch?\n> Is there any reason why git can’t recognize and apply rename-change which looks like this:\n>\n>     diff --git a/before.txt b/after.txt\n>     --- a/before.txt\n>     +++ b/after.txt\n\nSee https://github.com/git/git/blob/master/Documentation/diff-generate-patch.txt\nfor the status quo. I think most of it grew over time and made sense\nat the time of implementation,\nso the alternatives were maybe considered, you'd need to look for the\nold discussions around\nthe diff format.\n\n>\n> I’m implementing a program (with an IDE) to create patches compatible with Git and want to have better understanding of the format and possible issues with it.\n>\n> Thanks a lot in advance.\n>\n>\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"}]}