git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Not understanding with git wants to copy one file to another

From
Stefan Beller <sbeller@google.com>
Date
Aug 14, 2017, 18:07 UTC
Message-ID
<CAGZ79kaCuaxgGwuw7AHKTjsmwsTBuv=gWzeGDJv3TJv+b25Uvw@mail.gmail.com>
In-Reply-To
<87shgx3khv.fsf@local.lan>
On Fri, Aug 11, 2017 at 1:41 PM, Harry Putnam <reader@newsguy.com> wrote:
Show 25 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>
> [...]
>
>> Ah. Sorry for confusing even more.
>> By pointing out the options for git-diff, I just wanted to point out that
>> such a mechanism ("rename/copy detection") exists.
>
>
> [...]
>
>>> What am I missing?
>>>
>>
>> https://www.reddit.com/r/git/comments/3ogkk1/beginner_disable_rename_detection/
>>
>> "Rename detection is just GUI sugar".
>
> Thanks there is a nice full explanation at the cited url.
>
> What is still a bit puzzling is that in that same commit, there are
> files that are true copies of each other, just in different locations,
> But nothing pops up about them in a git commit.
>

The heuristic to find the renames/copies only looks at modified files to be fast(, the assumption is that each commit only touches few files, but the project consists of a lot of files).

For that git-diff knows about '--find-copies-harder' that looks at all files even those not modified. This would point out the true copies, I would assume.

I don't think we'd want to include the '--find-copies-harder' flag to status or commit, as it may take some time in large projects.

Previous: Harry PutnamNext: Junio C Hamano
Message 6 of 7 in “Not understanding with git wants to copy one file to another”
  1. Harry PutnamAug 10, 2017
  2. Stefan BellerAug 10, 2017
  3. Harry PutnamAug 10, 2017
  4. Stefan BellerAug 10, 2017
  5. Harry PutnamAug 11, 2017
  6. Stefan BellerAug 14, 2017
  7. Junio C HamanoAug 14, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.