git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hommey <mh@glandium.org>
To: git@vger.kernel.org
Subject: Should copy/rename detection consider file overwrites?
Date: Fri, 23 Jan 2015 10:29:08 +0900	[thread overview]
Message-ID: <20150123012908.GA8558@glandium.org> (raw)

Hi,

While fooling around with copy/rename detection, I noticed that it
doesn't detect the case where you copy or rename a file on top of
another:

$ git init
$ (echo foo; echo bar) > foo
$ git add foo
$ git commit -m foo
$ echo 0 > bar
$ git add bar
$ git commit -m bar
$ git mv -f foo bar
$ git commit -m foobar
$ git log --oneline --reverse
7dc2765 foo
b0c837d bar
88caeba foobar
$ git blame -s -C -C bar
88caebab 1) foo
88caebab 2) bar

I can see how this is not trivially representable in e.g. git diff-tree,
but shouldn't at least blame try to tell that those lines actually come
from 7dc2765?

Mike

             reply	other threads:[~2015-01-23  1:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  1:29 Mike Hommey [this message]
2015-01-23 11:04 ` Should copy/rename detection consider file overwrites? Jeff King
2015-01-23 22:37   ` Mike Hommey

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

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

  git send-email \
    --in-reply-to=20150123012908.GA8558@glandium.org \
    --to=mh@glandium.org \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).