I have a legacy project, also containing sources for several open source libraries. Unfortunately, some of the libraries are simple snapshots without any revision information.
I am looking for a way to identify the matching commit in the libraries repositories (git-driven).
What I've been doing so far, is some kind of mental 'bisecting' changes of single files, but these files are moved often between commits and following turned out to be rather difficult.
Preconditions, that could be utilized:
Why don't you do the following:
Clone the repository of the library
Overwrite the working tree with the version you have at hand
git diff against all commits:
#!/usr/bin/env bash for rev in $(git rev-list --all) do if git diff --exit-code $rev &> /dev/null then echo $rev fi done
Even if there is no exact match, this procedure can be easily enhanced to search for the revision with the least differences from your version.