Skip to content

Commit da6bb63

Browse files
committed
Updated the README instructions for rebasing with upstream.
1 parent 5bd3c9a commit da6bb63

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,35 @@ You only need the below if you plan to try and keep this library up to date with
5959
### Keeping up to date
6060

6161
```bash
62-
cd $GOPATH/src/github.com/youtube/vitess/go
62+
shopt -s nullglob
63+
VITESS=${GOPATH?}/src/github.com/youtube/vitess/go/
64+
XWB1989=${GOPATH?}/src/github.com/xwb1989/sqlparser/
6365

6466
# Create patches for everything that changed
6567
LASTIMPORT=1b7879cb91f1dfe1a2dfa06fea96e951e3a7aec5
66-
git format-patch $LASTIMPORT vt/sqlparser
67-
git format-patch $LASTIMPORT sqltypes
68-
git format-patch $LASTIMPORT bytes2
69-
git format-patch $LASTIMPORT hack
68+
for path in ${VITESS?}/{vt/sqlparser,sqltypes,bytes2,hack}; do
69+
cd ${path}
70+
git format-patch ${LASTIMPORT?} .
71+
done;
7072

71-
# Apply them to the repo
72-
cd $GOPATH/src/github.com/xwb1989/sqlparser
73-
git am -p4 ../../youtube/vitess/go/*.patch
73+
# Apply patches to the dependencies
74+
cd ${XWB1989?}
75+
git am --directory dependency -p2 ${VITESS?}/{sqltypes,bytes2,hack}/*.patch
76+
77+
# Apply the main patches to the repo
78+
cd ${XWB1989?}
79+
git am -p4 ${VITESS?}/vt/sqlparser/*.patch
7480

7581
# If you encounter diff failures, manually fix them with
7682
patch -p4 < .git/rebase-apply/patch
7783
...
7884
git add name_of_files
7985
git am --continue
8086

81-
# Finally update the LASTIMPORT in this README.
87+
# Cleanup
88+
rm ${VITESS?}/{sqltypes,bytes2,hack}/*.patch ${VITESS?}/*.patch
89+
90+
# and Finally update the LASTIMPORT in this README.
8291
```
8392

8493
### Fresh install

0 commit comments

Comments
 (0)