tags:

views:

35

answers:

0

Is there a git operation that does the reverse of ls-tree?

What i want to do is to be able to find a file and it's path by searching through git with a specific file hash. This would essentially mean giving ls-tree a file hash and not a tree hash

example:

git ls-tree <tree-hash>
>040000 tree d3b424d952ddeecc16c6953e0757acfa1c19a6f9 sub_dir
>100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 test.py

now search for this tree with just the hash of test.py

git <some command> e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
>040000 tree d3b424d952ddeecc16c6953e0757acfa1c19a6f9 sub_dir
>100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 test.py