LoginSignup
3
3

More than 5 years have passed since last update.

ライブラリのPR が取り込んでもらえなくて悲しい、が、とりあえず自分の修正を適用したい時

Last updated at Posted at 2015-12-16

(バグ|機能要望)あった!PR 送った! が、取り込んでもらえなくて悲しい

そんなことってありますよね! (悲)

そんなこともあろうかと、パッケージマネージャーには、Git Repository を指定する技法が整っているので、ひとまず指定して対応するという手もあります。ひとまず、自分の知っている範囲のメモ。

Ruby (Bundler)

パターン1: git リポジトリ指定

gem 'smtpapi', '~> 0.1.0', git: 'https://github.com/kawahara/smtpapi-ruby.git', branch: 'add-asm_groups_to_display'

パターン2: github option で指定。(1.8 から利用可能。2015年2月リリース)

以下の方法を使うと、勝手にgitリポジトリURLに展開される。見やすくて良い。

gem 'smtpapi', '~> 0.1.0', github: 'kawahara/smtpapi-ruby', branch: 'add-asm_groups_to_display'

参考: http://bundler.io/git.html

PHP (Composer)

Bundler に比べるとちょっと複雑。ドキュメントによると、svnやMercurial(hg)にも対応している。さらに、pear, pear2 など、他のパッケージマネージャーの参照も可能。なかなか高機能かつ、レガシーにも対応である。

Composer はブランチ/タグ名と、バージョン名が対応付されているシステムのため、特定のブランチ something を指定したい場合、dev-というプレフィックスを付けdev-something というバージョン名を指定する必要がある。

{
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/kawahara/rws-php-sdk"
        }
    ],
    "require": {
        "rakuten-ws/rws-php-sdk": "dev-master"
    }
}

備考: https://getcomposer.org/doc/05-repositories.md

JavaScript (npm)

git+ をURL前に付けて指定。#xxxx でブランチ名指定。

{
  "dependencies": {
    "express": "git+https://github.com/strongloop/express.git#master"
  }
}

備考: https://docs.npmjs.com/files/package.json#git-urls-as-dependencies

JavaScript (bower)

npm に似たような形式。

{
  "dependencies": {
    "angular": "https://github.com/angular/angular.js.git#v1.5.0-rc.0"
  }
}

備考: https://github.com/bower/spec/blob/master/json.md#dependencies

Java (Gradle)

git-repo プラグインを導入して、参照する。

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath group: 'com.layer', name: 'gradle-git-repo-plugin', version: '2.0.2'
    }
}

apply plugin: 'git-repo'

repositories {
    github("layerhq", "maven-private", "master", "releases")
    git("https://some/clone/url.git", "arbitrary.unique.name", "master", "releases")
}

備考: https://github.com/layerhq/gradle-git-repo-plugin

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3