Open1

Fuchsia 特定ブランチ のコードを取得してみる

junkawajunkawa

Fuchsia のコードは、複数の Git リポジトリ(Fuchsia本体のリポジトリ+third_partyリポジトリなど)からなっています。
jiri というツールで、これらの Git リポジトリを管理しています。

Fuchsiaの特定ブランチのコード一式を取得しようとするならば、jiri にお願いする必要があります。

これを一部修正します。

$ diff -u bootstrap.old bootstrap.new
--- ./bootstrap.old     2021-08-10 01:56:01.388216120 +0000
+++ ./bootstrap.new  2022-01-27 09:12:08.971409310 +0000
@@ -24,7 +24,7 @@
 curl -s "https://fuchsia.googlesource.com/jiri/+/HEAD/scripts/bootstrap_jiri?format=TEXT" | base64 --decode | bash -s fuchsia
 cd fuchsia
 
-.jiri_root/bin/jiri import -name=integration flower https://fuchsia.googlesource.com/integration
+.jiri_root/bin/jiri import -name=integration -remote-branch="releases/f6" flower https://fuchsia.googlesource.com/integration
 .jiri_root/bin/jiri update
 
 echo "Done creating a Platform Source Tree at \"$(pwd)\"."

jiri に -remote-branchオプションをつけることで特定のブランチを取得できます。

$ ./bootstrap.new
$ cd fuchsia
$ git log
commit 304ec12e9cd678ad8f2b729ea7eefe62a2bdb6e3 (HEAD, origin/releases/f6)
...

HEAD が releases/f6 ブランチのコミットを指していることがわかります。