git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bryan Turner <bturner@atlassian.com>
To: dylanyoungmeijer@gmail.com
Cc: Git Users <git@vger.kernel.org>
Subject: Re: [Possible GIT Bug]
Date: Sun, 9 Sep 2018 12:04:58 -0700	[thread overview]
Message-ID: <CAGyf7-EFiZ7ouUPDMtv3eb57QEiM2pkavyKQe7iNO7+eBeuZ9w@mail.gmail.com> (raw)
In-Reply-To: <CAPGJNu5=GkiALR1=RYgHLv3NDrycqv13jpU5_=SOW-yWtRXduw@mail.gmail.com>

On Sun, Sep 9, 2018 at 6:31 AM Dylan Young <dylanyoungmeijer@gmail.com> wrote:
>
> Works:
>
> git show -C --find-copies-harder  055f6c89fa4506037d1621761f13430f469b8029
>
> git show -C --find-copies-harder
> 055f6c89fa4506037d1621761f13430f469b8029 --name-status

Here, because you didn't provide _any_ paths, Git is allowed to
consider all of the paths modified in the commit and, because you
specified --find-copies-harder, it's allowed to consider paths that
_weren't_ modified too. That means it can "see" both the source and
destination for the copy, and it detects the copy as you're expecting.

>
> Doesn’t Work:
>
> git show -C --find-copies-harder
> 055f6c89fa4506037d1621761f13430f469b8029  --  PATH_TO_MY_COPIED_FILE

Here, though, you've _explicitly limited_ Git to only the copied file.
It's not allowed to consider any others, which means it can't "see"
the source path anymore. As a result, the copy is detected as a
straight add. Note that --find-copies-harder means the diff machinery
is allowed to consider files that weren't modified in the commit as
possible sources for copies, but that's still subject to your explicit
filtering. In other words, if PATH_TO_SOURCE_FILE wasn't modified,
running this would _not_ see a copy:

git show -C 055f6c89fa4506037d1621761f13430f469b8029  --
PATH_TO_MY_COPIED_FILE PATH_TO_SOURCE_FILE

But running this would:

git show -C -C 055f6c89fa4506037d1621761f13430f469b8029  --
PATH_TO_MY_COPIED_FILE PATH_TO_SOURCE_FILE

No bugs here. Everything is working as intended, if not, perhaps, as
you expected.

Hope this helps,
Bryan

>
> i.e.
>
> --- /dev/null
>
> +++ b/ PATH_TO_MY_COPIED_FILE
>
> Hope that’s self-explanatory!!!
>
> Best,
> Casey Meijer

  reply	other threads:[~2018-09-09 19:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPGJNu5RPXjeib-vayVzmFkU9cZ=h5o5VDoM1vQqv2+HgtNXLw@mail.gmail.com>
2018-09-09 13:30 ` Fwd: [Possible GIT Bug] Dylan Young
2018-09-09 19:04   ` Bryan Turner [this message]
2018-09-10 13:24     ` Jeff King
2018-09-10 16:03       ` Junio C Hamano
2018-09-10 17:35         ` Eckhard Maaß
2018-09-10 18:37           ` 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=CAGyf7-EFiZ7ouUPDMtv3eb57QEiM2pkavyKQe7iNO7+eBeuZ9w@mail.gmail.com \
    --to=bturner@atlassian.com \
    --cc=dylanyoungmeijer@gmail.com \
    --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.
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).