linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH -mm] Bisecting through -mm with quilt
Date: Fri, 23 Sep 2005 04:32:17 +0400	[thread overview]
Message-ID: <20050923003217.GA18675@mipter.zuzino.mipt.ru> (raw)

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


             reply	other threads:[~2005-09-23  0:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-23  0:32 Alexey Dobriyan [this message]
2005-09-23  0:42 ` [PATCH -mm] Bisecting through -mm with quilt Andrew Morton
2005-09-23 15:20   ` [PATCH -mm v2] " Alexey Dobriyan
2005-09-23 15:33     ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050923003217.GA18675@mipter.zuzino.mipt.ru \
    --to=adobriyan@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).