actually, there is a concept that could help, in addition to the normall commit hash there is als an object hash that is only made out of the diff and maybe the comment (not sure), now all that is needed is tools to find multiple occurances of these and connect them.
that search could be expensive though, so any commits found would need to be recorded somewhere.
greetings, martin.