Given the hash of a blob, is there a way to get a list of commits that have this blob in their tree?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both of the following scripts take the blob’s SHA1 as the first argument, and after it, optionally, any arguments that
git logwill understand. E.g.--allto search in all branches instead of just the current one, or-gto search in the reflog, or whatever else you fancy.Here it is as a shell script – short and sweet, but slow:
And an optimised version in Perl, still quite short but much faster: