[pve-devel] [RFC kernel 1/2] debian/scripts: add patchqueue scripts
Fabian Grünbichler
f.gruenbichler at proxmox.com
Tue Apr 3 13:30:37 CEST 2018
$ import-patchqueue repo dir [branch]
imports a (previously exported) patchqueue from 'dir' into a new branch
(default 'pq') in 'repo'
$ export-patchqueue repo dir ref
exports a patchqueue from 'ref' to current HEAD of 'repo' into 'dir'
'repo' can be any checked out non-bare repository, including worktrees or submodules.
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
note: these are separate scripts to help with manual rebasing and/or cherry-picking, and are called from import-upstream-tag from the next patch
debian/scripts/export-patchqueue | 30 ++++++++++++++++++++++++++++++
debian/scripts/import-patchqueue | 28 ++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)
create mode 100755 debian/scripts/export-patchqueue
create mode 100755 debian/scripts/import-patchqueue
diff --git a/debian/scripts/export-patchqueue b/debian/scripts/export-patchqueue
new file mode 100755
index 0000000..976d128
--- /dev/null
+++ b/debian/scripts/export-patchqueue
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+set -e
+
+top=$(pwd)
+
+if [ "$#" -ne 3 ]; then
+ echo "three parameters required."
+ exit 1
+fi
+
+# parameters
+kernel_submodule=$1
+kernel_patchdir=$2
+base_ref=$3
+
+cd "${kernel_submodule}"
+echo "clearing old exported patchqueue"
+rm -f "${top}/${kernel_patchdir}"/*.patch
+echo "exporting patchqueue using 'git format-patch [...] ${base_ref}.."
+git format-patch \
+ --quiet \
+ --no-numbered \
+ --no-cover \
+ --zero-commit \
+ --output-dir \
+ "${top}/${kernel_patchdir}" \
+ "${base_ref}.."
+
+cd "${top}"
diff --git a/debian/scripts/import-patchqueue b/debian/scripts/import-patchqueue
new file mode 100755
index 0000000..b096fd5
--- /dev/null
+++ b/debian/scripts/import-patchqueue
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -e
+
+top=$(pwd)
+
+if [ "$#" -lt 2 ]; then
+ echo "at least two parameters required."
+ exit 1
+fi
+
+
+# parameters
+kernel_submodule=$1
+kernel_patchdir=$2
+if [[ -z "$3" ]]; then
+ pq_branch='pq'
+else
+ pq_branch=$3
+fi
+
+cd "${kernel_submodule}"
+echo "creating patchqeueue branch '${pq_branch}'"
+git checkout -b "${pq_branch}"
+echo "importing patches from '${kernel_patchdir}'"
+git am "${top}/${kernel_patchdir}"/*.patch
+
+cd "${top}"
--
2.14.2
More information about the pve-devel
mailing list