Looking up objects that point to other objects
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 26, 2011, 19:01 UTC
- Message-ID
- <CACBZZX6sydEmuwj_C-KNocjra=6ynud5KFoezPd_Rr3bN4wh2w@mail.gmail.com>
Here's a couple of tasks that require brute-force with the Git object format that I've wanted to do at some point.
* Associate a blob with trees
Given a blob sha1 find trees that reference it.
* Associate trees with commits / other trees.
Given a tree find which commit points to that tree, or a parent tree N levels up the stack that a commit points to.
Has anyone written tools to do this? They'd obviously be very CPU and I/O intensive, but occasionally I encounter cases where I'd find this useful, e.g. to find what commit contains this huge blob, or what trees / commits are involved with a corrupted object.