Hash collision with renames, blank files, etc.

Open
#414 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start in hasher.py and compare the hash inputs for the two linked patch examples. Trace how renames and blank-file creations or deletions are represented, then verify that filenames and their operations affect the result. Done means these distinct diffs no longer produce identical hashes.

Written by the indexing model from the issue text.

Description

enhancement help wanted

The hash computation algorithm does not take into account file renames or new file creations, because of which if a diff has only renames or a blank file either being created or deleted, they all end up having the same hash. At the minimum, the filenames (and the operation on it) being hashed should be added to the hasher to eliminate these conflicts.

For example, these two patches end up with the same has with hasher.py:

https://patchwork.sourceware.org/project/glibc/patch/7c1fb956621e5644de7342022e4ae599b79b5626.1613577607.git.fweimer@redhat.com/
https://patchwork.sourceware.org/project/glibc/patch/20140621021718.2A4AA2C39AB@topped-with-meat.com/

Dominant language
Python
Stars
317
Forks
91
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getpatchwork/patchwork

All issues in getpatchwork/patchwork

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.