Thread (2 messages) flat view 2 messages, 2 authors, 2016-07-06

git patch format for rename

From: Nadya.Zabrodina@jetbrains.com <hidden>
Date: 2016-07-06 16:11:17

Hi,

could you please explain to me why  ‘rename from & rename to’ information is added to git patch? 

Here is the patch created by `git format-patch`: 

    diff --git a/before.txt b/after.txt
    similarity index 100%
    rename from before.txt
    rename to after.txt

Is there any reason why git can’t recognize and apply rename-change which looks like this:

    diff --git a/before.txt b/after.txt
    --- a/before.txt
    +++ b/after.txt
    
or even like this:
    diff --git a/before.txt b/after.txt


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.

Thanks a lot in advance.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help