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

Re: move detection doesnt take filename into account

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 9, 2014, 22:18 UTC
Message-ID
<xmqqa98i9nwc.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140709220337.GF25854@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I think the hash here does not collide in that way. It really is just
> the last sixteen characters shoved into a uint32_t.

All bytes overlap with their adjacent byte because they are shifted by only 2 bits, not 8 bits, when a new byte is brought in. We can say that the topmost two bits of the result must have come from the last character, but other than these, there are more than one input byte for each bit position to be set/unset by, so two names that human would not consider "similar" would be given the same hash, no?

That is useful for delta code because the code only needs that similar things are grouped together, it does not mind things that are not similar is also mixed to a group, as the end result is primarily determined by similarity of the actual contents, not pathnames.

What is under topic in this discussion is the other way around; we know two paths have contents of the same similarity to the third one and want to tie-break these two using how similar their pathnames are to the third one.

Previous: Jeff KingNext: Jeff King
Message 10 of 11 in “move detection doesnt take filename into account”
  1. Elliot WolkJun 30, 2014
  2. Robin RosenbergJul 1, 2014
  3. Elliot WolkJul 1, 2014
  4. Junio C HamanoJul 1, 2014
  5. Elliot WolkJul 1, 2014
  6. Junio C HamanoJul 1, 2014
  7. Jeff KingJul 9, 2014
  8. Junio C HamanoJul 9, 2014
  9. Jeff KingJul 9, 2014
  10. Junio C HamanoJul 9, 2014
  11. Jeff KingJul 10, 2014

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.