Re: How to keep log history when renaming and changing simultaneously
- Date: Mon, 17 Apr 2017 19:17:18 +0700
- From: Duy Nguyen <pclouds@xxxxxxxxx>
- Subject: Re: How to keep log history when renaming and changing simultaneously
On Mon, Apr 17, 2017 at 6:36 PM, Urs Thuermann <urs@xxxxxxxxxxxxxxxxx> wrote:
> Sometimes I need to rename and change a file in one commit. One
> example would be a file foo.h that begins with
> #ifndef FOO_H
> #define FOO_H
> which should be renamed bar.h and have the FOO_H changed to BAR_H.
> In subversion I would
> svn mv foo.h bar.h; vi bar.h; svn ci
> and then a
> svn log bar.h
> also shows the history of that file when it was named foo.h.
> This does not work in git.
> Is there a better way to do this in git?
We could if we allowed rename annotation, similar to that "svn mv"
command. I worked on that a while back  then I stopped because of a
design conflict. But I'm almost convinced Jeff and Junio were right
(and I wrong) now so I will likely revive that series before 2019