aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-07-27 15:23:22 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2022-07-28 00:25:34 +0200
commitb53b30651fe0c9a2c80ee241b1c626f3205128bb (patch)
treecd26c0df496c6be97e4dc93cc6fb7d2827460c40
parenta2380560e0019805e9e0ea956e1914f30de9a044 (diff)
downloadpw-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-xpw-apply6
-rwxr-xr-xpw-pull6
2 files changed, 8 insertions, 4 deletions
diff --git a/pw-apply b/pw-apply
index 36f8c45..2a97575 100755
--- a/pw-apply
+++ b/pw-apply
@@ -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
diff --git a/pw-pull b/pw-pull
index 84ed0eb..877bc1f 100755
--- a/pw-pull
+++ b/pw-pull
@@ -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'