初めてPull Requestをマージしてみた

ずいぶん前に redmine_importer プラグインを github でフォークしてごにょごにょしてたところに Pull Request がきた。
しかもRedmine本の著者の前田さんだー!すごい人から Pull Request がきて緊張するw

入門Redmine 第2版 Linux/Windows対応

入門Redmine 第2版 Linux/Windows対応

で、はじめて Pull Request をマージしてみた。

A-Liaison BLOG: github で pull request をされたとき・するときの手順 などを参考にしつつやってみる。
まずは、Pull Request を受け取るブランチを作る。

$ git checkout -b pull_request_i18n_fix_for_redmine_1.2

で、github からの pull request 通知メールに書かれていたコマンドを実行してみた。

$ git pull https://github.com/farend/redmine_importer i18n_fix_for_redmine_1.2
remote: Counting objects: 23, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 12 (delta 7), reused 12 (delta 7)
Unpacking objects: 100% (12/12), done.
From https://github.com/farend/redmine_importer
 * branch            i18n_fix_for_redmine_1.2 -> FETCH_HEAD
Updating 94216f7..cc694e5
Fast-forward
 app/views/importer/match.html.erb  |    2 +-
 app/views/importer/result.html.erb |    6 +++---
 config/locales/en.yml              |   10 +++++-----
 config/locales/ja.yml              |   10 +++++-----
 config/locales/zh.yml              |    6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)

マージされたのかな?logを見てみる。

$ git log -n 1
commit cc694e5558f05cf6be736d2f9c8231478adceb2e
Author: MAEDA Go
Date:   Wed Oct 5 09:43:48 2011 +0900

    fix for Redmine 1.2: removed deprecated "%d" and "%s" format strings.

おー、マージされてる!きちんと修正されて、動作するのも確認した。感謝!
で、Pull したコードを master にマージする。

$ git checkout master
Switched to branch 'master'
$ git merge pull_request_i18n_fix_for_redmine_1.2
Updating 94216f7..cc694e5
Fast-forward
 app/views/importer/match.html.erb  |    2 +-
 app/views/importer/result.html.erb |    6 +++---
 config/locales/en.yml              |   10 +++++-----
 config/locales/ja.yml              |   10 +++++-----
 config/locales/zh.yml              |    6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)

そのまま、github へ push!

$ git push origin master
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:daicham/redmine_importer.git
   94216f7..cc694e5  master -> master

まとめ

  • Pull Request きたらどうすればいいかわかった
    • といっても、普通に Pull するだけだった
  • マージ用のブランチ作成はしたほうがいい、トピックブランチのように扱えばいい
  • Pull Request くるとなぜかうれしい感じがする
  • せっかくだから、wikiにプラグインの説明書こう