jpw
jpw

Reputation: 19247

How see which version of Rails a particular commit was applied to?

Frequently when researching a problem, I come across a commit in Rails that addresses the issue.

But how does someone see which version of Rails first incorporated that fix?

For example, an issue with a missing /tmp/pid folder was fixed in this Rails commit: https://github.com/rails/rails/commit/70e6ff2ed8596eb9bd6dcce87cb3f14015638d70

But how can I see which version of Rails included that fix?

Upvotes: 1

Views: 176

Answers (1)

max
max

Reputation: 102055

To see what specific version includes a certain commit you need to look at the tags in the repository:

max@pop-os ~/p/rails> git tag --contains 70e6ff2ed8596eb9bd6dcce87cb3f14015638d70
v6.0.1
v6.0.1.rc1
v6.0.2
v6.0.2.1
v6.0.2.2
v6.0.2.rc1
v6.0.2.rc2
v6.0.3
v6.0.3.1
v6.0.3.2
v6.0.3.3
v6.0.3.4
v6.0.3.rc1

git branch --contains <commit id> can also be used to find new commits that are not yet tagged. Such as commits on master that haven't yet been "released".

To do this you first need to clone the repository off Github and fetch all the branches (or a least the stable branches).

Upvotes: 5

Related Questions