]> Untitled Git - hvutilities.git/commitdiff
hvk: add hvk-stack
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 2 Feb 2026 17:17:20 +0000 (12:17 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Wed, 25 Feb 2026 19:47:54 +0000 (14:47 -0500)
Signed-off-by: Hugo Villeneuve <hugo@hugovil.com>
scripts/Makefile.am
scripts/hvk-stack [new file with mode: 0644]

index 863972c46b4fac0f3d53dfe33eb8761d5676857c..477ed2738d6453481bbddad7b47491f92851058b 100644 (file)
@@ -26,6 +26,7 @@ dist_bin_SCRIPTS = \
     hvk-rebase.sh \
     hvk-save-defconfig.sh \
     hvk-select.sh \
+    hvk-stack \
     hvk-x86.sh \
     iso8859-to-utf8.sh \
     kernel-send-patches.sh \
diff --git a/scripts/hvk-stack b/scripts/hvk-stack
new file mode 100644 (file)
index 0000000..c526718
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+SCRIPT="`readlink -e $0`"
+SCRIPTPATH=$(dirname ${SCRIPT})
+
+if [ ${#} -lt 1 -o ${#} -gt 2 ]; then
+    echo "Invalid number of arguments (1 or 2)"
+    exit 1
+fi
+
+if [ ${#} -eq 2 ]; then
+    branch_base="${1}"
+    branch_to_rebase="${2}"
+elif [ ${#} -eq 1 ]; then
+    branch_base="$(git branch --show-current)"
+    branch_to_rebase="${1}"
+fi
+
+git checkout "${branch_to_rebase}"
+git rebase ${branch_base}