-1

Using git cat-file I can look at objects in the Key-value store but I am only interested in log messages. How do I filter out those?

murungu
  • 2,090
  • 4
  • 21
  • 45
  • You use `git log`. You should specify why you need to examine the git database and not use the API provided. – patthoyts Jun 05 '15 at 12:00
  • Unfortunately this is a slightly broken git repository, migrated using git-svn. There is no head or refs, therefore git log fails. I need to retrieve the logs in some other way, ie by accessing the object database directly. – murungu Jun 05 '15 at 12:10
  • for commit in $(cat all.git.object.file); do git cat-file -t $commit; done | grep commit – murungu Jun 05 '15 at 12:18
  • Would the person who down voted this please bare in mind that I was recovering log messages from a corrupt git repository after migrating using git-svn. The log messages were there, but the git log command was not working. I had to find another way to retrieve the logs. – murungu Aug 21 '15 at 12:29

1 Answers1

0

Firstly Make a list of all git object ids. Then use git cat-file -t and grep to filter all commits

murungu
  • 2,090
  • 4
  • 21
  • 45