git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sofia Syrianidou <sofia.syrianidou@suse.com>
Cc: git@vger.kernel.org
Subject: Re: diff-filter=R can't identify renaming if not done directly
Date: Fri, 04 Dec 2020 12:07:03 -0800	[thread overview]
Message-ID: <xmqqlfede3o8.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <19eb8038-20d6-385f-50e5-26c7a0bd8e90@suse.com> (Sofia Syrianidou's message of "Fri, 4 Dec 2020 15:37:02 +0100")

Sofia Syrianidou <sofia.syrianidou@suse.com> writes:

> Hello, quick question about using diff-filter in linux. In the scenario
> that in my repository, I first copy file1 to file2, then move file2 to
> file3 and delete file1, "git diff" returns
>
>
> diff --git a/file1 b/file3
>
> similarity index 100%
>
> rename from file 1
>
> rename to file3
>
>
>   but running "git diff --diff-filter=r" doesn't return anything. Only
> flag T will return the change. Can this be considered as a bug?

"git diff --diff-filter=r" and "git diff --diff-filter=R" have
totally opposite meanings.  I expect nothing to be shown if all your
changes are renames and you ask to exclude all the renamed filepairs
from the output with "--diff-filter=r".  In other words, this seems
to be working as intended.

Thanks.


      reply	other threads:[~2020-12-04 20:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 14:37 diff-filter=R can't identify renaming if not done directly Sofia Syrianidou
2020-12-04 20:07 ` Junio C Hamano [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=xmqqlfede3o8.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sofia.syrianidou@suse.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 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).