Created
March 17, 2021 19:03
-
-
Save bradfitz/889d7c3db6d0907f3653a56a88c38415 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
set -x | |
cd $HOME | |
rm -rf netstack.bare netstack | |
git clone --bare $HOME/gvisor netstack.bare | |
cd netstack.bare | |
git-filter-repo $(for x in LICENSE \ | |
AUTHORS \ | |
pkg/tcpip \ | |
pkg/binary \ | |
pkg/goid \ | |
pkg/linewriter \ | |
pkg/gohacks \ | |
pkg/log \ | |
pkg/rand \ | |
pkg/sleep \ | |
pkg/state \ | |
pkg/sync \ | |
pkg/waiter; do | |
echo --path-match=$x; | |
done) \ | |
--path-rename pkg/tcpip:tcpip \ | |
--path-rename pkg/binary:binary \ | |
--path-rename pkg/goid:goid \ | |
--path-rename pkg/linewriter:linewriter \ | |
--path-rename pkg/gohacks:gohacks \ | |
--path-rename pkg/log:log \ | |
--path-rename pkg/rand:rand \ | |
--path-rename pkg/sleep:sleep \ | |
--path-rename pkg/state:state \ | |
--path-rename pkg/sync:sync \ | |
--path-rename pkg/waiter:waiter | |
git-filter-repo --invert-paths \ | |
--path='tcpip/link/fdbased' \ | |
--path='tcpip/link/tun' \ | |
--path='state/statefile' \ | |
--path='state/pretty' \ | |
--path-match=XXX | |
cd $HOME | |
git clone $HOME/netstack.bare $HOME/netstack | |
cd $HOME/netstack | |
git checkout go | |
go mod init inet.af/netstack | |
perl -i -npe 's,"gvisor.dev/gvisor/pkg/,"inet.af/netstack/,' $(git grep -l gvisor.dev) | |
go mod tidy | |
git fetch [email protected]:inetaf/netstack meta | |
git merge --allow-unrelated-histories FETCH_HEAD | |
git push [email protected]:inetaf/netstack HEAD:main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
😱