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
HPHarry Putnam <reader@newsguy.com>
Date
Aug 10, 2017, 18:18 UTC
Message-ID
<87efsj70d7.fsf@local.lan>
In-Reply-To
<CAGZ79kbgb2P7KT_b9xuMj1pN1+jsPfH7YSJNDyDB5dY3cwXCQg@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
> On Thu, Aug 10, 2017 at 10:03 AM, Harry Putnam <reader@newsguy.com> wrote:
[...]
Harry wrote:
Show 5 quoted lines
>> Here are two that are at least kind of similar but would never be seen
>> as the same:
>>
>> < 192.168.1.43      m2.local.lan       m2       # 00-90-F5-A1-F9-E5
>>> 192.168.1.43    m2.local.lan        m2         # win 7
 Stefan B replied:
Show 10 quoted lines
> The diff machinery has a threshold for when it assumes
> a copy/move of a file. (e.g. "A file is assumed copied when
> at least 55% of lines are equal")
>
> https://git-scm.com/docs/git-diff
>
> See -C and -M option.
>
> git-status seems to use this machinery as well, but does
> not expose the options?

Well, now I'm even more confused. What actually happens? Is either file changed? Is only one file kept?

On the surface it sounds like complete anathema to what git is all about.

However, I know a tool this sophisticated is not doing something just outright stupid... so must be really missing the point here.

I get the way you can make -M stricter or not... but I didn't call git-diff to see that copy thing comeup.

I called git commit.

There must be some way to set stricter guidlines to calling things copies.

But then I must really not get it because it still seems almost silly to consider one file a copy of another if only 55% is the same.

What am I missing?
Previous: Stefan BellerNext: Stefan Beller
Message 3 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.