OpenCoderX
OpenCoderX

Reputation: 6318

Which commit was a specific release on rubygems created from?

I am trying to create a release history, how can I identify which commit a specific version of a gem was created from on rubygems.com? When I extract the *.gem archive it does not include any logging of the commit.

EDIT: The releases were pushed to rubygems without updating the github repo with the relevant tags, I want to backfill github with the appropriate release tags.

Upvotes: 1

Views: 100

Answers (2)

spickermann
spickermann

Reputation: 106922

Simple answer: You cannot!

Versions of a gem on Rubygems and commits or tags in Git are two totally different concepts and have nothing in common.

You already discovered that the gem doesn't contain any information about the use of git or a specific commit. And if you think about that, it makes sense that gems do not contain information about the version control system that was used:

  • There is no need to use Rubygems and Git at the same time. Actually, there is no need to use any version control system at all when you build gems.
  • And even if the author used a version control system, there are other version control systems – like SVN or Mercurial for example.
  • Even if the author used Git to keep track of their source code changes, they could still create and upload multiple different versions of the gem without doing a single git commit in the meantime.
  • And even if the author did a commit for every gem version, then – depending on the configuration of the gem and the git repository – both systems can include files which exist on one system but not on the other.

That said, the assumption that a specific gem version corresponds with a specific git commit is just valid.

Upvotes: 2

lacostenycoder
lacostenycoder

Reputation: 11226

Normally there will be a link to the source code on the gem page of rubygems.org

From there you should be taken to the repo, for example if you visit https://rubygems.org/gems/devise you will see link on the right side of the page that says Source Code which should link to

https://github.com/plataformatec/devise/

Then you can just click on releases at the top of the repo or go to https://github.com/plataformatec/devise/releases

There you will see the commit the release was built from.

If you just download the .gem file from rubygems.org that will only include the gem code itself and not the git history whatsoever. If you want the full git history you should clone the repo to your local machine. To do so, click on the Clone or download button at the top of the repo's home page. If you copy the url from there, can just go to your terminal and type

git clone <paste repo url here>

Upvotes: 0

Related Questions