LoginSignup
2
2

More than 5 years have passed since last update.

StashでPullRequestのメッセージをカスタマイズする

Last updated at Posted at 2013-07-18

Attlassian社から提供されるStashPull Request を受け入れた場合、強制的に

Merge branch 'master' into …

というメッセージが表示されます。
このメッセージは Stash2.5.2においてはメッセージを変更する事は出来ません。
但し、このメッセージ自体はローカルであれば --no-commit を利用して変更する事が可能です。またローカルで操作する事で、 PullRequestのステータスもcloseされます。

ここでは、その手順について書きます。

1.まずブランチを切ります。

root:sandbox (master) $ git checkout -b work01
Switched to a new branch 'work01'

2.適当に編集します。

root:sandbox (work01) $ vim README.md

3.コミットします。

root:sandbox (work01) $ git commit -am "add helloworld"
[work01 ad1eb88] add helloworld
 1 file changed, 1 insertion(+)

4.pushします。

root:sandbox (work01) $ git push origin work01:work01
Counting objects: 5, done.
Writing objects: 100% (3/3), 248 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://git@localhost:7999/san/sandbox.git
 * [new branch]      work01 -> work01

5.StashからPushしたブランチをPullRequestします。

kobito.1374113507.595320.png

6.StashでPullRequestが来ますが、ここではレビューのみ行い実際にMergeまでは行いません。

kobito.1374113832.461406.png

7.ここからはローカルで作業します。共有リポジトリの最新を取得します。

root:sandbox (master) $ git fetch
root:sandbox (master) $ git pull origin master
From ssh://localhost:7999/san/sandbox
 * branch            master     -> FETCH_HEAD

8.ローカルでwork01をマージします。

root:sandbox (master) $ git merge --no-ff --no-commit work01
Automatic merge went well; stopped before committing as requested
root:sandbox (master|MERGING) $ git commit
[master e09d767] 任意のコミット内容を記述

9.mergeが問題なければ共用リポジトリにpushします。

root:sandbox (master) $ git push origin master
Counting objects: 1, done.
Writing objects: 100% (1/1), 254 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To ssh://git@localhost:7999/san/sandbox.git
   834716f..e09d767  master -> master

10.Stashから結果を確認します。work01のPullRequestがマージされた事が分かります。
kobito.1374114206.673473.png

結論

Stash上はhashが変わっていなければPullRequestをマージしたと認識してくれるようです。

以上です。

2
2
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
2
2