1

i cloned a copy of the git-wiki for some educational programming. now, as a challange, i tried to figure out how to get the date for the blob.

the blob is fetched with

repository.tree/(page_name + extension)

as far as i saw it, you can only get a date for a commit. but how to get the latest commit containing the blob?

mheck
  • 11
  • 1
  • possible duplicate of [Git: Which commit has this blob?](http://stackoverflow.com/questions/223678/git-which-commit-has-this-blob) – Cascabel Nov 27 '10 at 14:23

1 Answers1

1

You can do it like this.

repository.log("master", "app/models/....", :max_count => 5, :skip => 1)

then you'll get commits related to the blob. The first param is a branch name and the second is the path of the blod. :max_count and :skip are optional parameters. Take a look at grit's rubyforge for more functionality. This question is also helpful.

Community
  • 1
  • 1
Yuki Nishijima
  • 1,802
  • 2
  • 16
  • 19