[PATCH] stable: Added stable-patches.sh

Tim Gardner tim.gardner at canonical.com
Wed Feb 24 15:28:59 UTC 2021


Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 stable/stable-patches.sh | 41 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100755 stable/stable-patches.sh

diff --git a/stable/stable-patches.sh b/stable/stable-patches.sh
new file mode 100755
index 00000000..58bed9e9
--- /dev/null
+++ b/stable/stable-patches.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Extract a list of patches that have gone in to each stable branch. This script
+# is tailored to be run against https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
+#
+
+if [ ! -f .git/config ]
+then
+	echo You must run this script within a git repository.
+	exit 1
+fi
+
+if ! git branch -a | egrep -q "linux-3\.0\.y"
+then
+	echo This does not look like the stable linux repository.
+	echo git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
+	exit 1
+fi
+
+# Get the latest commit objects and tags
+git fetch origin --tags
+
+#
+# Linux stable branches after linux-2.A.B.y are of the form linux-A.B.y. Ignore linux-2.A.B.y branches
+# since none of the kernels we deal with are based on a 2.x kernel. I think we can also ignore
+# linux-rolling-lts and linux-rolling-stable since any patch in those branches is also in one
+# of the other linux-A.B.y branches.
+#
+git branch -a | egrep -v "linux-2" | egrep "remotes.*linux.*[0-9]" | sed -e 's;remotes/origin/linux-;;' -e 's;\.; ;g' |\
+while read a b y
+do
+	echo linux-$a.$b.y
+	git fetch origin linux-$a.$b.y
+	git log --pretty=oneline v$a.$b..remotes/origin/linux-$a.$b.y > linux-$a.$b.y.txt
+done
+
+#
+# Now you can grep for your patch subject and quickly figure out what branshes have it. For example,
+#
+# grep "USB: serial: add IDs for WinChipHead USB->RS232 adapter" *.txt
+#
-- 
2.17.1




More information about the kernel-team mailing list