Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem: integrate change from pull request

I am having issues with a gem and found that someone was able to fix it in this pull request:

https://github.com/rheaton/carrierwave-video/pull/13

How can I integrate this change into my app locally since it has been merged yet?

like image 762
scientiffic Avatar asked Sep 27 '13 18:09

scientiffic


2 Answers

Assuming you're using Bundler, you can specify the repository and branch to use for the gem in your Gemfile (it also supports specifying a tag or a reference hash, but a branch should work for your case). In this case, it might look something like:

gem 'carrierwave-video', :git => 'git://github.com/elja/carrierwave-video.git', :branch => 'patch-1'

or, more concisely:

gem 'carrierwave-video', :github => 'elja/carrierwave-video', :branch => 'patch-1'

This isn't a great long-term solution, since the branch is unlikely to continue to keep up to date properly, and might disappear, so you should probably switch back to the default as soon as the pull request is resolved.

like image 70
MrTheWalrus Avatar answered Sep 22 '22 15:09

MrTheWalrus


You can use GitHub's pull request refs with Bundler's git source to point at the ref for the head of the pull request without having to change the repository to the author's fork and communicating that you're following the pull request, like:

gem "carrierwave-video", github: "rheaton/carrierwave-video", ref: "refs/pull/13/head"
like image 42
sj26 Avatar answered Sep 21 '22 15:09

sj26