linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm] Bisecting through -mm with quilt
@ 2005-09-23  0:32 Alexey Dobriyan
  2005-09-23  0:42 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2005-09-23  0:32 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Quick, Dirty, Fragile, Should Work (TM).

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 mm-bisect |   83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)

diff -uprN linux-vanilla/mm-bisect linux-mm-bisect/mm-bisect
--- linux-vanilla/mm-bisect	1970-01-01 03:00:00.000000000 +0300
+++ linux-mm-bisect/mm-bisect	2005-09-23 04:25:26.000000000 +0400
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Bisecting through -mm.
+#
+# Assumptions
+# -----------
+# 1) X works
+# 2) X-mmY doesn't
+# 3) -mmY in broken-out form is in $QUILT_PATCHES, "quilt push -a"'d
+#
+# Usage cycle
+# -----------
+#	mm-bisect start
+#		...			<=== applying/reverting patches
+#	[recompile]
+#	[retest]
+# 	mm-bisect good			<=== if it works
+#		...
+#	[recompile]
+#	[retest]
+#	mm-bisect bad			<=== if it doesn't
+#		[...]
+#	Sucker is fix-typo.patch	<=== who to blame
+
+usage()
+{
+	echo >&2 'usage: mm-bisect [start | good | bad]'
+	exit 1
+}
+
+case "$#" in
+0)
+	usage
+	;;
+*)
+	CUR=$(quilt applied | wc -l)
+	case "$1" in
+	start)
+		echo 0 >.mm-bisect-good
+		echo $CUR >.mm-bisect-bad
+		;;
+	good)
+		if [ $(($(cat .mm-bisect-bad) - $CUR)) = 1 ]; then
+			quilt push -q >/dev/null
+			echo -n "Sucker is "
+			quilt top
+			rm -f .mm-bisect-bad .mm-bisect-good
+			exit 0
+		fi
+		echo $CUR >.mm-bisect-good
+		;;
+	bad)
+		if [ $(($CUR - $(cat .mm-bisect-good))) = 1 ]; then
+			echo -n "Sucker is "
+			quilt top
+			rm -f .mm-bisect-bad .mm-bisect-good
+			exit 0
+		fi
+		echo $CUR >.mm-bisect-bad
+		;;
+	*)
+		usage
+		;;
+	esac
+	GOOD=$(cat .mm-bisect-good)
+	BAD=$(cat .mm-bisect-bad)
+	MIDDLE=$((($BAD + $GOOD) / 2))
+	echo "[$GOOD .. $BAD] => $MIDDLE"
+	if [ $MIDDLE -lt $CUR ]; then
+		while [ $MIDDLE -lt $(quilt applied | wc -l) ]; do
+			quilt pop -q | sed -e "s/^Removing patch/-/" \
+						-e "/^Now at patch /d"
+		done
+	else
+		while [ $MIDDLE -gt $(quilt applied | wc -l) ]; do
+			quilt push -q | sed -e "s/^Applying patch/+/" \
+						-e "/^Now at patch /d"
+		done
+	fi
+	quilt top
+	echo "[$GOOD .. => $MIDDLE <= .. $BAD]"
+esac


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-23 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-23  0:32 [PATCH -mm] Bisecting through -mm with quilt Alexey Dobriyan
2005-09-23  0:42 ` Andrew Morton
2005-09-23 15:20   ` [PATCH -mm v2] " Alexey Dobriyan
2005-09-23 15:33     ` Alexey Dobriyan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).