git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Urs Thuermann <urs@isnogud.escape.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: How to keep log history when renaming and changing simultaneously
Date: Mon, 17 Apr 2017 19:17:18 +0700	[thread overview]
Message-ID: <CACsJy8B5r+Xoo8s9xbwaUrQhEODzN4Uk5z9RjbKXMwM-W5m=HQ@mail.gmail.com> (raw)
In-Reply-To: <ygfpogbb711.fsf@tehran.isnogud.escape.de>

On Mon, Apr 17, 2017 at 6:36 PM, Urs Thuermann <urs@isnogud.escape.de> 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 [1] 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
hits.

[1] http://public-inbox.org/git/1453287968-26000-1-git-send-email-pclouds@gmail.com/
-- 
Duy

  reply	other threads:[~2017-04-17 12:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-17 11:36 How to keep log history when renaming and changing simultaneously Urs Thuermann
2017-04-17 12:17 ` Duy Nguyen [this message]
2017-04-17 20:34 ` Igor Djordjevic
2017-04-17 21:36   ` Urs Thuermann
2017-04-18  1:15     ` Jacob Keller
2017-04-18  3:20       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACsJy8B5r+Xoo8s9xbwaUrQhEODzN4Uk5z9RjbKXMwM-W5m=HQ@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=urs@isnogud.escape.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).