If I ls-tree
a certain tree and get a list of blobs and trees, how can I discover the last commit related to those blobs and trees? I'm looking for something like this:
$ git ls-tree HEAD
...
100644 blob 734713bc047d87bf7eac9674765ae793478c50d3 myfile
...
$ git show --commit 734713bc047d87bf7eac9674765ae793478c50d3
commit 734713bc047d87bf7eac9674765ae793478c50d3
Author: Scott Chacon <[email protected]>
Date: Fri Jan 2 18:32:33 2009 -0800
fixed refs handling, added gc auto, updated tests
I'm bit confused. I don't understand why you need something like this. But, I think this is what you want-
git ls-tree --name-only HEAD | while read file; do git log -n 1 --date=short --pretty="$file, author: %an, commit: %h, date: %ad, msg: '%s'" -- $file; done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With