* [PATCH 1/3] Bisect: refactor "bisect_write_*" functions.
@ 2007-10-24 5:01 Christian Couder
0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2007-10-24 5:01 UTC (permalink / raw)
To: Junio Hamano, Shawn O. Pearce, Johannes Schindelin; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
git-bisect.sh | 46 ++++++++++++++++++++--------------------------
1 files changed, 20 insertions(+), 26 deletions(-)
This patch series change the title of 3 patches in the
"bisect skip" series from "Bisect: factorise ..." to
"Bisect: refactor ...".
In the second patch in this series a missing line has
also been added back.
diff --git a/git-bisect.sh b/git-bisect.sh
index cd46190..82aa404 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -108,9 +108,9 @@ bisect_start() {
}
if [ $bad_seen -eq 0 ]; then
bad_seen=1
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
else
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
fi
shift
;;
@@ -122,6 +122,18 @@ bisect_start() {
bisect_auto_next
}
+bisect_write() {
+ state="$1"
+ rev="$2"
+ case "$state" in
+ bad) tag="$state" ;;
+ good|skip) tag="$state"-"$rev" ;;
+ *) die "Bad bisect_write argument: $state" ;;
+ esac
+ echo "$rev" >"$GIT_DIR/refs/bisect/$tag"
+ echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
+}
+
bisect_bad() {
bisect_autostart
case "$#" in
@@ -132,17 +144,11 @@ bisect_bad() {
*)
usage ;;
esac || exit
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
bisect_auto_next
}
-bisect_write_bad() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/bad"
- echo "# bad: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_good() {
bisect_autostart
case "$#" in
@@ -153,18 +159,12 @@ bisect_good() {
for rev in $revs
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
-bisect_write_good() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/good-$rev"
- echo "# good: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_skip() {
bisect_autostart
case "$#" in
@@ -175,18 +175,12 @@ bisect_skip() {
for rev in $revs
do
rev=$(git rev-parse --verify "$rev^{commit}") || exit
- bisect_write_skip "$rev"
+ bisect_write 'skip' "$rev"
echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
done
bisect_auto_next
}
-bisect_write_skip() {
- rev="$1"
- echo "$rev" >"$GIT_DIR/refs/bisect/skip-$rev"
- echo "# skip: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
-}
-
bisect_next_check() {
missing_good= missing_bad=
git show-ref -q --verify refs/bisect/bad || missing_bad=t
@@ -395,15 +389,15 @@ bisect_replay () {
eval "$cmd"
;;
good)
- bisect_write_good "$rev"
+ bisect_write 'good' "$rev"
echo "git-bisect good $rev" >>"$GIT_DIR/BISECT_LOG"
;;
bad)
- bisect_write_bad "$rev"
+ bisect_write 'bad' "$rev"
echo "git-bisect bad $rev" >>"$GIT_DIR/BISECT_LOG"
;;
skip)
- bisect_write_skip "$rev"
+ bisect_write 'skip' "$rev"
echo "git-bisect skip $rev" >>"$GIT_DIR/BISECT_LOG"
;;
*)
--
1.5.3.4.215.g187cf
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-10-24 4:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 5:01 [PATCH 1/3] Bisect: refactor "bisect_write_*" functions Christian Couder
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).