[sr-dev] git:master:888f8d6b: uac_redirect Rename module file #82

Daniel-Constantin Mierla miconda at gmail.com
Wed Feb 11 21:42:09 CET 2015


On 11/02/15 21:24, Olle E. Johansson wrote:
> On 11 Feb 2015, at 21:16, Daniel-Constantin Mierla <miconda at gmail.com> wrote:
>
>> You should use
>>
>> git mv ...
>>
>> in order to preserve the history of the file.
>>
>> Removing existing one and adding it is losing that.
> I did use "git mv"
>
> $ git commit
> [master e0a20eb] app_java Rename module interface file
>  8 files changed, 6 insertions(+), 6 deletions(-)
>  rename modules/app_java/{java_mod.c => app_java_mod.c} (100%)
>  rename modules/app_java/{java_mod.h => app_java_mod.h} (100%)
>
> It is weird that the mail message shows something else...
It seems to be git behaviour when the change is consistent. Found on the
net that the rename itself should be a single commit in order to
preserve history in 'git log'. See:

-
https://coderwall.com/p/_csouq/renaming-and-changing-files-in-git-without-losing-history

Even with a rename as part of a bigger change, history can be seen when
using --follow for git-log, like:

git log --follow modules/uac_redirect/uac_redirect.c

But git web viewer don't do that usually. Therefore, it is better to do
just the rename as single commit. Eventually will work fine to see all
history.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com




More information about the sr-dev mailing list