Saturday, 24 December 2011

Finding the tag that contains a commit in git

I was trying to figure out the exact version when RbConfig was introduced to Ruby 1.8.

So I checked out Ruby from http://github.com/ruby/ruby and then changed to the Ruby 1.8 branch:

% git checkout ruby_1_8

I found the commit in question with a combination of git log and git blame:

% git show c24a0d897e97c3bb8cc32effd6ca5e9bd9de58c1

Then I used git describe to found the containing tag:

% git describe --contains c24a0d897e97c3bb8cc32effd6ca5e9bd9de58c1
v1_8_5_preview1~259

Version 1.8.5. Too easy.

No comments:

Post a Comment