All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Ron Garret <ron1@flownet.com>
Cc: git@vger.kernel.org
Subject: Re: A git-mv question
Date: Tue, 02 Feb 2010 07:32:45 -0800 (PST)	[thread overview]
Message-ID: <m3r5p3ac2e.fsf@localhost.localdomain> (raw)
In-Reply-To: <ron1-09EE6C.16083801022010@news.gmane.org>

Ron Garret <ron1@flownet.com> writes:

> If I do a git-mv *and* edit the file all in one commit, does that get 
> recorded in a way that allows git to track the change through the 
> changed file name?  In other words, if I do just a git-mv (without 
> changing the file) git can track that by observing that two differently 
> named objects in two different commit trees contain the same blob.  But 
> if the file is edited then the blobs will be different.  Is git smart 
> enough to distinguish a git-mv and edit from, say, the equivalent git-rm 
> and git-add?  If so, how does it do it?

Git does not distinguish between git-mv and equivalent git-rm+git-add;
it employs heuristic similarity based (based on how contents of files
is similar to each other) rename detection.

Also worth noting is that git does consider only endpoints for rename
detection in diff and in merge; it does not check history if there
were clean rename / rename + edit.

-- 
Jakub Narebski
Poland
ShadeHawk on #git

      parent reply	other threads:[~2010-02-02 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02  0:08 A git-mv question Ron Garret
2010-02-02  0:29 ` Nicolas Pitre
2010-02-02  0:46   ` Junio C Hamano
2010-02-02  7:21   ` Ron Garret
2010-02-02 15:32 ` Jakub Narebski [this message]

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=m3r5p3ac2e.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ron1@flownet.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.