Skip to content

Commit 777c9da

Browse files
committed
Add rustup pull command
1 parent 19931e2 commit 777c9da

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

scripts/rustup.sh

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,30 @@ case $1 in
2727
git commit -m "Rustup to $(rustc -V)"
2828
;;
2929
"push")
30-
cg_clif=$(pwd)
31-
pushd ../rust
32-
branch=update_cg_clif-$(date +%Y-%m-%d)
33-
git checkout -b "$branch"
34-
git subtree pull --prefix=compiler/rustc_codegen_cranelift/ https://github.com/bjorn3/rustc_codegen_cranelift.git master
35-
git push -u my "$branch"
36-
popd
30+
cg_clif=$(pwd)
31+
pushd ../rust
32+
git pull origin master
33+
branch=sync_cg_clif-$(date +%Y-%m-%d)
34+
git checkout -b "$branch"
35+
git subtree pull --prefix=compiler/rustc_codegen_cranelift/ https://github.com/bjorn3/rustc_codegen_cranelift.git master
36+
git push -u my "$branch"
37+
38+
# immediately merge the merge commit into cg_clif to prevent merge conflicts when syncing
39+
# from rust-lang/rust later
40+
git subtree push --prefix=compiler/rustc_codegen_cranelift/ "$cg_clif" sync_from_rust
41+
popd
42+
git merge sync_from_rust
3743
;;
44+
"pull")
45+
cg_clif=$(pwd)
46+
pushd ../rust
47+
git pull origin master
48+
rust_vers="$(git rev-parse HEAD)"
49+
git subtree push --prefix=compiler/rustc_codegen_cranelift/ "$cg_clif" sync_from_rust
50+
popd
51+
git merge sync_from_rust -m "Sync from rust $rust_vers"
52+
git branch -d sync_from_rust
53+
;;
3854
*)
3955
echo "Unknown command '$1'"
4056
echo "Usage: ./rustup.sh prepare|commit"

0 commit comments

Comments
 (0)