merge_scratch gui_scratch desktop - smalruby/smalruby3-gui GitHub Wiki

本家Scratchのscratch-desktopブランチのマージ手順

本家Scratchのdevelopブランチのマージ手順の初期手順 を行って、本家Scratchのレポジトリを手元に登録する。

手元の scratch-desktop ブランチを最新にする。

(最初の1回)
git fetch -p scratch-gui
git checkout -b scratch-desktop scratch-gui/scratch-desktop 

(2回目以降)
git checkout scratch-desktop
git pull --rebase

ログをみて、最新のマージ済みのdevelopブランチのコミットIDやタグ名を把握する。

git log
(Merge tag '0.1.0-prerelease.20200113203847' into scratch-desktop のようなログを探す)

そのコミットIDやタグ名をもとに変更点をpatchにする。

git diff 0.1.0-prerelease.20200113203847 > scratch-desktop.patch

手元のsmalruby3-desktopブランチに上のパッチを適用する。

(最初の1回)
git checkout -b smalruby3-desktop origin/smalruby3-desktop

(2回目以降)
git checkout smalruby3-desktop

patch -p1 < scratch-desktop.patch
(全てnなので、enterキーを押し続ける。以下、実行例)
patching file package-lock.json
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file package-lock.json.rej
patching file package.json
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file package.json.rej
patching file src/components/library-item/library-item.jsx
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
4 out of 4 hunks ignored -- saving rejects to file src/components/library-item/library-item.jsx.rej
patching file src/components/library/library.jsx
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
5 out of 5 hunks ignored -- saving rejects to file src/components/library/library.jsx.rej
The next patch would create the file src/components/scratch-image/scratch-image.jsx,
which already exists!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/components/scratch-image/scratch-image.jsx.rej
patching file src/containers/library-item.jsx
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file src/containers/library-item.jsx.rej
patching file src/index.js
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file src/index.js.rej
patching file test/integration/costumes.test.js
Hunk #1 succeeded at 197 (offset 4 lines).

*.rejを確認しながら、すべての修正が適用済みであることを確認する。

もし変更点があればコミットする。コミットログに merge scratch-desktop (dcf2b8e07c7fe5dee1dbc73f5d549313100b7fc2) のようにscratch-desktopの最新のコミットIDを追加する。 最新のコミットIDの確認方法。

git log -n 1 scratch-gui/scratch-desktop

smalruby3-guiの最新に追従する。

git merge origin/develop
ここでコンフリクトを解消する。

 - package-lock.json: 修正せずに package.json を修正後に npm install で解消できる
 - src/containers/library-item.jsx: HEAD
 - test/integration/costumes.test.js: HEAD

git commit
(ログはそのまま)

最低限の動作確認。 smalruby3-guiの最新の機能が含まれていることを確認する。 scratch-desktop側の確認は特になし。

pushして完了。

git push origin smalruby3-desktop