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

Re: [PATCH v6 6/6] blame: use a fingerprint heuristic to match ignored lines

From
Michael Platings <michael@platin.gs>
Date
Apr 14, 2019, 09:41 UTC
Message-ID
<CAJDYR9RHb89mjT65XVERJfo3cTySi++ZAwOFftBtyXkqfC=JOQ@mail.gmail.com>
In-Reply-To
<xmqqk1fxw8ad.fsf@gitster-ct.c.googlers.com>
Show 5 quoted lines
>  - I wonder if the hash used here can replace what is used in
>    diffcore-delta.c as an improvement (or obviously vice versa), as
>    using two (or more) ad-hoc fingerprinting function without having
>    a clear reason why we need two instead of a unified one feels
>    like a bad idea.

Hi Junio, If I understand correctly, the algorithm in diffcore-delta.c is intended to match files that contain identical lines (or 64-byte chunks). The fingerprinting that Barret & I are talking about is intended to match lines that contain identical byte pairs. With significant refactoring, you could make the diffcore-delta algorithm apply in both cases but I think the end result would be longer and more complicated than keeping the two separate. Unlike hashing a line, hashing a byte pair is trivial. Unlike hashing lines, all except the first and last bytes are included in two "hashes" - "hello" is hashed to "he", "el", "ll", "lo". So based on my limited understanding of diffcore-delta.c I think the two are algorithms are sufficiently different in intent and in implementation that it's appropriate to keep them separate.

Regarding the "old heuristic" I think there may still be a use case for that but I'll expand on that later.

Thanks, -Michael

Previous: Junio C HamanoNext: Barret Rhoden
Message 20 of 25 in “blame: add the ability to ignore commits”
  1. 0/6 blame: add the ability to ignore commitsBarret Rhoden, Apr 10, 2019
  2. 1/6 Move init_skiplist() outside of fsckBarret Rhoden, Apr 10, 2019
  3. Ævar Arnfjörð BjarmasonApr 10, 2019
  4. Barret RhodenApr 15, 2019
  5. 2/6 blame: use a helper function in blame_chunk()Barret Rhoden, Apr 10, 2019
  6. 3/6 blame: add the ability to ignore commits and their changesBarret Rhoden, Apr 10, 2019
  7. Ævar Arnfjörð BjarmasonApr 10, 2019
  8. Michael PlatingsApr 14, 2019
  9. Barret RhodenApr 15, 2019
  10. Barret RhodenApr 15, 2019
  11. 4/6 blame: add config options to handle output for ignored linesBarret Rhoden, Apr 10, 2019
  12. Junio C HamanoApr 14, 2019
  13. Michael PlatingsApr 14, 2019
  14. Junio C HamanoApr 14, 2019
  15. Michael PlatingsApr 14, 2019
  16. Barret RhodenApr 15, 2019
  17. 5/6 blame: optionally track line fingerprints during fill_blame_origin()Barret Rhoden, Apr 10, 2019
  18. 6/6 blame: use a fingerprint heuristic to match ignored linesBarret Rhoden, Apr 10, 2019
  19. Junio C HamanoApr 14, 2019
  20. Michael PlatingsApr 14, 2019
  21. Barret RhodenApr 15, 2019
  22. Junio C HamanoApr 16, 2019
  23. Michael PlatingsApr 14, 2019
  24. Barret RhodenApr 15, 2019
  25. Michael PlatingsApr 15, 2019

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.