From 715a51a0d6963f9d727191d4e1ad0690fd28c4dd Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 2 Dec 2021 12:59:45 +0100 Subject: [rubygems/rubygems] Feature: accept pull request URLs as github source Very often github source is used to temporarily use a modified gem while a PR upstream is being reviewed. So for instance https://github.com/ruby/bigdecimal/pull/211 will look like: ```ruby gem "bigdecimal", github: "casperisfine/bigdecimal", branch: "git-gem" # https://github.com/ruby/bigdecimal/pull/200 ``` It's annoying because you have to fiddle with the branch name, which is copied as `casperisfine:git-gem`, etc etc. If I could simply use the PR URL like this: ``` gem "bigdecimal", github: "https://github.com/ruby/bigdecimal/pull/211" ``` It would make a very common task for me so much simpler. https://github.com/rubygems/rubygems/commit/517c527751 --- lib/bundler/man/gemfile.5.ronn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/bundler/man/gemfile.5.ronn') diff --git a/lib/bundler/man/gemfile.5.ronn b/lib/bundler/man/gemfile.5.ronn index ea7cf40e63..0feaf58246 100644 --- a/lib/bundler/man/gemfile.5.ronn +++ b/lib/bundler/man/gemfile.5.ronn @@ -372,6 +372,14 @@ Are both equivalent to Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument. +You can also directly pass a pull request URL: + + gem "rails", :github => "https://github.com/rails/rails/pull/43753" + +Which is equivalent to: + + gem "rails", :github => "rails/rails", branch: "refs/pull/43753/head" + ### GIST If the git repository you want to use is hosted as a GitHub Gist and is public, you can use -- cgit v1.2.3