diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-07-27 15:23:22 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-07-28 00:25:34 +0200 |
commit | b53b30651fe0c9a2c80ee241b1c626f3205128bb (patch) | |
tree | cd26c0df496c6be97e4dc93cc6fb7d2827460c40 | |
parent | a2380560e0019805e9e0ea956e1914f30de9a044 (diff) | |
download | pw-b53b30651fe0c9a2c80ee241b1c626f3205128bb.tar.gz |
pw-apply/pw-pull: Don't hard code master
Use the current branch name as the base, don't hard code "master".
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rwxr-xr-x | pw-apply | 6 | ||||
-rwxr-xr-x | pw-pull | 6 |
2 files changed, 8 insertions, 4 deletions
@@ -129,6 +129,8 @@ done [ ! -z "$accept" ] && accept_series $series [ ! -z "$cover" ] && cover_from_url $cover +target=$(git branch --show-current) + body= author=XYZ if [ ! -z "$auto_branch" ]; then @@ -165,7 +167,7 @@ if [ -z "$merge" ]; then else git am $am_flags mbox.o if [ ! -z "$edits" ] ; then - git rebase -i master + git rebase -i "$target" fi while [ -d .git/rebase-merge ]; do echo -ne "\rWaiting for rebase to finish $(date)" @@ -173,7 +175,7 @@ else done echo fi -git checkout master +git checkout "$target" if [ ! -z "$merge" ]; then git merge --stat --log --no-edit --no-ff $branch if [ ! -z "$cover" ]; then @@ -43,6 +43,8 @@ done srv=$(git config --get pw.server) srv=${srv%/} # strip trailing slash +target=$(git branch --show-current) + if [ ! -z "$pull" ]; then pull_json=$(curl -s $srv/patches/$pull/) @@ -94,7 +96,7 @@ if [ ! -z "$series" ]; then git checkout -b $series_branch git am -3 mbox.i rm -f mbox.i - git checkout master + git checkout "$target" fi git pull --stat --log --no-edit --no-ff $pull_url @@ -158,7 +160,7 @@ EOF fi if [ ! -z "$series" ]; then - if git diff master..$series_branch --exit-code; then + if git diff "$target"..$series_branch --exit-code; then echo -e '\e[0;32mSeries matches PR\e[0m' else echo -e '\n\n\e[1;31mSeries differs!!\e[0m\n' |