git-filter-repo icon indicating copy to clipboard operation
git-filter-repo copied to clipboard

minor: Logic error with `_commits_referenced_but_removed` on a GitHub Gist web url in commit message 😂

Open Challanger524 opened this issue 1 year ago • 5 comments

After filtering branch got this in suboptimal-issues:

The following commits were filtered out, but referenced in another commit message. The reference to the now-nonexistent commit hash (or a substring thereof) was left as-is in any commit messages: b'c52b069e4be2d87a6d2f'

In my case the only place of mention of that hash is next commit message:

e10: Dealing with Errors in OpenGL (+glDebugMessageCallback) ... [liam-middlebrook/GLDebugMessageCallback.c](https://gist.github.com/liam-middlebrook/c52b069e4be2d87a6d2f)

While the git-filter-repo source code comment says:

    # A set of commit hash references appearing in commit messages which
    # mapped to a valid commit that was removed entirely in the filtering
    # process.  The commit message will continue to reference the
    # now-missing commit hash, since there was nothing to map it to.
    self._commits_referenced_but_removed = set()

"valid commit that was removed entirely in the filtering", Karl 🤯 This hash never related to my git commit history and appears only in a web-url to a GitHub Gist 😂

Looks like code doesn't verify old commit hashes properly

Challanger524 avatar Feb 23 '24 16:02 Challanger524

Yeah, seems to be more of a bug in the description than in the code logic; I think I assumed when I wrote the description that any hash-looking things would refer to commits and valid commits. It's not that I didn't verify old commit hashes properly, it's that I didn't do any verification and never pretended to and just assumed that's the only thing that would be mentioned. I could add some, I guess, or I could just update the description appropriately.

Either way, thanks for the report.

newren avatar Aug 02 '24 05:08 newren