git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Yuri D'Elia <wavexx@users.sf.net>
Cc: git@vger.kernel.org
Subject: Re: rename tracking and file-name swapping
Date: Sun, 13 Sep 2009 11:14:12 -0700	[thread overview]
Message-ID: <7viqfmsoej.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <wavexx-2ECE7F.13171313092009@ger.gmane.org> (Yuri D'Elia's message of "Sun\, 13 Sep 2009 13\:17\:13 +0200")

Yuri D'Elia <wavexx@users.sf.net> writes:

> Hi everyone. Does rename tracking recognize two file names being swapped?
>
> % ls -l
> total 24
> -rw-rw-r--   1 wavexx  wavexx  5952 Sep 13 13:09 file1.txt
> -rw-rw-r--   1 wavexx  wavexx  3330 Sep 13 13:09 file2.txt
> % mv file1.txt file3.txt 
> % mv file2.txt file1.txt
> % mv file3.txt file2.txt
> % git add file1.txt file2.txt 
> % git diff -M --stat --cached
>  file1.txt |  150 +++++++++++++++++++++++-------------------------------------
>  file2.txt |  150 +++++++++++++++++++++++++++++++++++++-----------------------
>  2 files changed, 150 insertions(+), 150 deletions(-)

By default, if the pathname that was present in the old version still
appears in the new version, that path is not considered as a candiate
for rename detection.  Only "X used to be there but is gone" and "Y did
not exist but appeared" are paired up and checked if they are similar.

Give the command -B option, too, to break the filepair that does not
disappear.

  reply	other threads:[~2009-09-13 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-13 11:17 rename tracking and file-name swapping Yuri D'Elia
2009-09-13 18:14 ` Junio C Hamano [this message]
2009-09-13 21:13   ` Yuri D'Elia
2009-09-14  6:44     ` Johannes Sixt
2009-09-15  3:34   ` [Bug?] "diff -B --color" output doesn't show space errors Nanako Shiraishi
2009-09-15  4:44     ` Junio C Hamano
2009-09-15  5:05       ` [PATCH] diff --whitespace: fix blank lines at end 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

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

  git send-email \
    --in-reply-to=7viqfmsoej.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=wavexx@users.sf.net \
    /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).